Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add SequenceSet methods for querying about duplicates #384

Merged
merged 2 commits into from
Jan 24, 2025

Conversation

nevans
Copy link
Collaborator

@nevans nevans commented Jan 24, 2025

Adds three new SequenceSet methods for querying about "duplicates":

  • #has_duplicates?: Returns whether the ordered entries contain any duplicates.
  • #count_duplicates: Returns the count of duplicates in the ordered entries.
  • #count_with_duplicates: Returns the count of numbers in the ordered entries, including any repeated numbers.

This splits off "normalized" vs "order preserving" methods in the
"What's here?" sections.
Adds three new SequenceSet methods for querying about "duplicates":
* `#has_duplicates?`: Returns whether the ordered entries contain any
  duplicates.
* `#count_duplicates`: Returns the count of duplicates in the ordered
  entries.
* `#count_with_duplicates`: Returns the count of numbers in the ordered
  entries, including any repeated numbers.

This is useful for adding guards to `CopyUIDData` and `UIDPlusData`, and
for getting the size of `SequenceSet#each_ordered_number` (another PR).
@nevans nevans merged commit a9e1ce9 into master Jan 24, 2025
37 checks passed
@nevans nevans deleted the sequence-set-ordered-duplicates-methods branch January 24, 2025 22:51
@nevans nevans added the enhancement New feature or request label Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

1 participant