Skip to content

union() keeps duplicates for small arrays #2811

Description

@Noethix55555

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions