Skip to content

Fix SparseArray capacity bug and remove dead code in BitSet.Any#307

Open
fkjkkll wants to merge 2 commits into
genaray:masterfrom
fkjkkll:fix/bitSet-any-and-sparseArray-capacity
Open

Fix SparseArray capacity bug and remove dead code in BitSet.Any#307
fkjkkll wants to merge 2 commits into
genaray:masterfrom
fkjkkll:fix/bitSet-any-and-sparseArray-capacity

Conversation

@fkjkkll
Copy link
Copy Markdown

@fkjkkll fkjkkll commented Jun 7, 2026

  • SparseSet.AddSparseArray: pass Capacity instead of type.Id to SparseArray constructor.
    Matches how StructuralSparseSet does it.
  • BitSet.Any: remove two redundant loops over [min, _max). If this BitSet has bits set
    in that range, _highestBit is already > 0, so the final return yields false regardless.

fkjkkll added 2 commits June 7, 2026 16:21
Passing type.Id as capacity was incorrect — it should be the SparseSet's
Capacity, matching how StructuralSparseSet does it.
The extra loops over [min, _max) are dead code — if any bits are set
in that range, _highestBit > 0, so the final return already yields false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant