summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-02-22 20:48:37 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-02-22 20:48:37 -0800
commit6af39064ca9d9a78d0e12e64cb817f9080cf3793 (patch)
tree336efee13eeee5f633cacf4208091ab876bbb919 /hash.c
parent91477b902ec2c36d893e72e99916469f99558ac9 (diff)
downloadtxr-6af39064ca9d9a78d0e12e64cb817f9080cf3793.tar.gz
txr-6af39064ca9d9a78d0e12e64cb817f9080cf3793.tar.bz2
txr-6af39064ca9d9a78d0e12e64cb817f9080cf3793.zip
hashing: provide unsafe hash count.
* hash.c (us_hash_count): New function. Blindly assumes that the argument is a hash. * hash.h (us_hash_count): Declared.
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index eadfe959..3dde4dca 100644
--- a/hash.c
+++ b/hash.c
@@ -886,6 +886,12 @@ val hash_count(val hash)
return num_fast(h->count);
}
+val us_hash_count(val hash)
+{
+ struct hash *h = coerce(struct hash *, hash->co.handle);
+ return num_fast(h->count);
+}
+
val get_hash_userdata(val hash)
{
val self = lit("get-hash-userdata");