Skip to content

Commit 067c891

Browse files
committed
Remove redundant guards
1 parent 8e461b8 commit 067c891

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Data/HashMap/Base.hs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,8 @@ instance (Eq k, Eq v) => Eq (HashMap k v) where
266266

267267
equal :: (k -> k' -> Bool) -> (v -> v' -> Bool)
268268
-> 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 [])
272271
where
273272
-- If the two trees are the same, then their lists of 'Leaf's and
274273
-- 'Collision's read from left to right should be the same (modulo the
@@ -329,9 +328,8 @@ cmp cmpk cmpv (HashMap _ t1) (HashMap _ t2) =
329328

330329
-- Same as 'equal' but doesn't compare the values.
331330
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 [])
335333
where
336334
go (Leaf k1 l1 : tl1) (Leaf k2 l2 : tl2)
337335
| k1 == k2 && leafEq l1 l2

0 commit comments

Comments
 (0)