diff options
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -115,22 +115,20 @@ static cnum ll_hash(val obj) lazy_str_force(obj); return ll_hash(obj->ls.prefix); case COBJ: - if (obj->co.ops->hash) - return obj->co.ops->hash(obj); - return ((cnum) obj) & NUM_MAX; + return obj->co.ops->hash(obj); } internal_error("unhandled case in equal function"); } -val hash_obj(val obj) +cnum cobj_hash_op(val obj) { - return num(ll_hash(obj)); + return ((cnum) obj) & NUM_MAX; } -static val hash_equal(val self, val other) +val hash_obj(val obj) { - return self == other ? t : nil; + return num(ll_hash(obj)); } static void hash_destroy(val hash) @@ -187,11 +185,11 @@ static void hash_mark(val hash) } static struct cobj_ops hash_ops = { - hash_equal, + cobj_equal_op, cobj_print_op, hash_destroy, hash_mark, - 0 + cobj_hash_op }; static void hash_grow(struct hash *h) |