union() keeps duplicates for small arrays
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 7.3k
- Forks
- 637
- PR merge metrics
- No merged PRs in 30d
Description
union() in lib/utils/objectUtils.js uses a Set for large inputs (deduping both arrays) but a plain copy of the first array for small ones (deduping only the second). So duplicates in the first array survive only on the small-array path: union([1, 1, 2], [2, 3]) returns [1, 1, 2, 3] instead of [1, 2, 3].
PR: #2809
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read lib/utils/objectUtils.js and trace the small-array and large-array paths in union(). Check the reported example and compare both paths; done means duplicates are removed from the first array as well as the second, including for small inputs.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100