From 7cf66ee31d57cb31f784c4e5983828ae01dfc4d2 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 7 Apr 2018 20:16:03 -0700 Subject: case macros: bugfix: use hash for caseql and casequal too. * eval.c (me_case): Correct the condition. We want to generate for all the case comparison types. The only situation we want to avoid is when the keys do not use eq equality, but caseq is used. The reason is that the underlying hash table is eql-based, not eq-based: it's not the right kind of hash table for caseql/caseql*. We can only use it if two keys might be eql that are not eq. --- eval.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 072e38b6..72a5f973 100644 --- a/eval.c +++ b/eval.c @@ -3900,8 +3900,7 @@ static val me_case(val form, val menv) eval_error(form_orig, lit("~s: improper form terminated by ~s"), casesym, form, nao); if (!compat && gt(hash_count(hash), num_fast(10)) && - ((casesym == caseq_s || casesym == caseq_star_s) && - all_keys_eq)) + ((casesym != caseq_s && casesym != caseq_star_s) || all_keys_eq)) { return list(let_star_s, list(list(tformsym, testform, nao), list(idxsym, -- cgit v1.2.3