From 8d84ffa58f835367ceab1d77d07ff3a72f09378d Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 25 Jun 2019 02:25:11 -0700 Subject: nullify: handle carray and hashes. * lib.c (nullify): Add carray and hash subcases into the COBJ case. --- lib.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib.c') diff --git a/lib.c b/lib.c index 7614aab2..7d47a042 100644 --- a/lib.c +++ b/lib.c @@ -1011,6 +1011,10 @@ val nullify(val seq) case BUF: return if3(length_buf(seq) != zero, seq, nil); case COBJ: + if (seq->co.cls == carray_s) + return if3(length_carray(seq) != zero, seq, nil); + if (seq->co.cls == hash_s) + return if3(hash_count(seq) != zero, seq, nil); if (obj_struct_p(seq)) { val nullify_meth = maybe_slot(seq, nullify_s); if (nullify_meth) -- cgit v1.2.3