Closed Methuselah96 closed 3 years ago
Possibly related: https://github.com/immutable-js-oss/immutable-js/pull/4
I am willing to investigate on that, but I don't understand the original issue.
I tried to copy the code and "it works". I do not understand what "Check 2 cases" is in the original issue. 🤔
@Methuselah96 Do you have an hint or is this bug fixed ?
@jdeniau Here's a reproduction of the issue: https://codesandbox.io/s/elegant-saha-edmb7?file=/src/index.js
Notice that the the two console.log
statements are outputting different numbers. They should both be 32.
@jdeniau It's also worth keeping https://github.com/immutable-js-oss/immutable-js/pull/4 in mind because they might be related or a similar issue.
@Methuselah96 Well in this case, this issue has somehow been fixed. I added only tests cases in #198
In your codesandbox, allItems.subtract(existingItems).size
is 32
, but in the tests on master, it is 15 (which is expected).
From @pixmaster on Thu, 13 Jun 2019 11:46:48 GMT
What happened
Incorrect
subtract
result whenSet
contains 32+ elements and subtracted elements is n/2+1How to reproduce
Check 2 cases when
capacity
is less than 32 and equal or more than 32Copied from original issue: https://github.com/immutable-js/immutable-js/issues/1716