File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -266,9 +266,8 @@ instance (Eq k, Eq v) => Eq (HashMap k v) where
266
266
267
267
equal :: (k -> k' -> Bool ) -> (v -> v' -> Bool )
268
268
-> HashMap k v -> HashMap k' v' -> Bool
269
- equal eqk eqv (HashMap s1 t1) (HashMap s2 t2)
270
- | s1 == s2 = go (toList' t1 [] ) (toList' t2 [] )
271
- | otherwise = False
269
+ equal eqk eqv (HashMap s1 t1) (HashMap s2 t2) =
270
+ (s1 == s2) && go (toList' t1 [] ) (toList' t2 [] )
272
271
where
273
272
-- If the two trees are the same, then their lists of 'Leaf's and
274
273
-- 'Collision's read from left to right should be the same (modulo the
@@ -329,9 +328,8 @@ cmp cmpk cmpv (HashMap _ t1) (HashMap _ t2) =
329
328
330
329
-- Same as 'equal' but doesn't compare the values.
331
330
equalKeys :: (k -> k' -> Bool ) -> HashMap k v -> HashMap k' v' -> Bool
332
- equalKeys eq (HashMap s1 t1) (HashMap s2 t2)
333
- | s1 == s2 = go (toList' t1 [] ) (toList' t2 [] )
334
- | otherwise = False
331
+ equalKeys eq (HashMap s1 t1) (HashMap s2 t2) =
332
+ (s1 == s2) && go (toList' t1 [] ) (toList' t2 [] )
335
333
where
336
334
go (Leaf k1 l1 : tl1) (Leaf k2 l2 : tl2)
337
335
| k1 == k2 && leafEq l1 l2
You can’t perform that action at this time.
0 commit comments