Skip to content

Commit 76c949b

Browse files
committed
Remove mostly redundant ptr equality checks.
These seem to be particularly unlikely to help given the above changes, as they still require traversing the spine.
1 parent 2183a93 commit 76c949b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

containers/src/Data/Set/Internal.hs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -836,10 +836,8 @@ union t1 Tip = t1
836836
union t1 (Bin 1 x _ _) = insertR x t1
837837
union (Bin 1 x _ _) t2 = insert x t2
838838
union Tip t2 = t2
839-
union t1@(Bin _ x l1 r1) t2 = case splitS x t2 of
840-
(l2 :*: r2)
841-
| l1l2 `ptrEq` l1 && r1r2 `ptrEq` r1 -> t1
842-
| otherwise -> link x l1l2 r1r2
839+
union (Bin _ x l1 r1) t2 = case splitS x t2 of
840+
(l2 :*: r2) -> link x l1l2 r1r2
843841
where !l1l2 = union l1 l2
844842
!r1r2 = union r1 r2
845843
#if __GLASGOW_HASKELL__

0 commit comments

Comments
 (0)