Skip to content

Conversation

@SajanGhimire1
Copy link

  • Added a debug assertion in SortedSet::new_unchecked to ensure the inner OrderedSet is already sorted.
  • Updated SortedSet::union to return a properly sorted SortedSet instead of an unsorted iterator.
  • Ensures that all SortedSet instances maintain the invariant that elements are sorted, improving safety and correctness.

This fixes potential issues where unsorted elements could be introduced and guarantees that union operations produce a valid SortedSet.

- Added a debug assertion in `SortedSet::new_unchecked` to ensure
  the inner OrderedSet is already sorted.
- Updated `SortedSet::union` to return a properly sorted
  `SortedSet` instead of an unsorted iterator.
- Ensures that all SortedSet instances maintain the invariant
  that elements are sorted, improving safety and correctness.

This fixes potential issues where unsorted elements could
be introduced and guarantees that union operations produce
a valid SortedSet.
@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jan 13, 2026
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Jan 13, 2026

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D90589173. (Because this pull request was imported automatically, there will not be any future comments.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant