summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authordearblue <[email protected]>2018-12-14 21:41:07 +0900
committerdearblue <[email protected]>2018-12-14 21:41:07 +0900
commit62dd4d89fc6da2c38a9bc1913c1f25566a9e443e (patch)
tree72b9516a663caf936631386da725d58a45729518 /include
parentec812c646fa9740e6309712065c26e0563795178 (diff)
downloadmruby-62dd4d89fc6da2c38a9bc1913c1f25566a9e443e.tar.gz
mruby-62dd4d89fc6da2c38a9bc1913c1f25566a9e443e.zip
Add `mrb_hash_size()` function.
Diffstat (limited to 'include')
-rw-r--r--include/mruby/hash.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/mruby/hash.h b/include/mruby/hash.h
index 911a96042..ce51b2016 100644
--- a/include/mruby/hash.h
+++ b/include/mruby/hash.h
@@ -166,6 +166,19 @@ MRB_API mrb_value mrb_hash_values(mrb_state *mrb, mrb_value hash);
MRB_API mrb_value mrb_hash_clear(mrb_state *mrb, mrb_value hash);
/*
+ * Get hash size.
+ *
+ * Equivalent to:
+ *
+ * hash.size
+ *
+ * @param mrb The mruby state reference.
+ * @param hash The target hash.
+ * @return The hash size.
+ */
+MRB_API mrb_int mrb_hash_size(mrb_state *mrb, mrb_value hash);
+
+/*
* Copies the hash.
*
*