Skip to content

Commit dc790ab

Browse files
committed
Revert "Revert new_ optimization"
This reverts commit 3315dba.
1 parent fc018df commit dc790ab

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Data/HashMap/Internal.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2310,9 +2310,9 @@ updateOrConcatWithKey :: Eq k => (k -> v -> v -> (# v #)) -> A.Array (Leaf k v)
23102310
updateOrConcatWithKey f ary1 ary2 = A.run $ do
23112311
let n1 = A.length ary1
23122312
let n2 = A.length ary2
2313-
mary <- A.new_ (n1 + n2)
2313+
mary <- A.new (n1 + n2) (A.index ary1 1)
23142314
-- copy over all elements from ary1
2315-
A.copy ary1 0 mary 0 n1
2315+
A.copy ary1 1 mary 1 (n1-1)
23162316
-- append or update all elements from ary2
23172317
let go !iEnd !i2 !iMut
23182318
| i2 >= n2 = return iEnd

0 commit comments

Comments
 (0)