Skip to content

Refactor VectorSet to use Vector+Set instead of VectorMap#80

Merged
bishabosha merged 1 commit into
dotty-staging:stdlib/seq-setfrom
artimahub:stdlib/seq-set-artima-cs
Jul 17, 2026
Merged

Refactor VectorSet to use Vector+Set instead of VectorMap#80
bishabosha merged 1 commit into
dotty-staging:stdlib/seq-setfrom
artimahub:stdlib/seq-set-artima-cs

Conversation

@cheeseng

Copy link
Copy Markdown
  • Changed internal representation from VectorMap[A, Unit] to Vector[A] + Set[A]
  • This simplifies the implementation and provides better performance characteristics
  • Update tail/init to properly throw UnsupportedOperationException on empty set
  • Add early return for empty Iterable in from() method

Update tests to cover all branches:

  • Add test for incl on empty set
  • Add test for knownSize on empty set
  • Add tests for tail/init throwing on empty set
  • Add test for VectorSet.from(VectorSet) identity case
  • Add test for VectorSet.from(empty Iterable) returning empty
  • Add test for builder clear() and result() on empty builder
  • Add test for SeqSet.from(SeqSet) identity case

This change ensures 100% branch coverage of VectorSet implementation.

- Changed internal representation from VectorMap[A, Unit] to Vector[A] + Set[A]
- This simplifies the implementation and provides better performance characteristics
- Update tail/init to properly throw UnsupportedOperationException on empty set
- Add early return for empty Iterable in from() method

Update tests to cover all branches:
- Add test for incl on empty set
- Add test for knownSize on empty set
- Add tests for tail/init throwing on empty set
- Add test for VectorSet.from(VectorSet) identity case
- Add test for VectorSet.from(empty Iterable) returning empty
- Add test for builder clear() and result() on empty builder
- Add test for SeqSet.from(SeqSet) identity case

This change ensures 100% branch coverage of VectorSet implementation.

LLM-assisted changes.
@bishabosha

Copy link
Copy Markdown

oh yeah thats much more obvious way to do it, thanks!

@bishabosha
bishabosha merged commit d4c7aa2 into dotty-staging:stdlib/seq-set Jul 17, 2026
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.

2 participants