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

🐛 Fix SequenceSet count dups with multiple "*" #387

Merged
merged 1 commit into from
Jan 27, 2025

Conversation

nevans
Copy link
Collaborator

@nevans nevans commented Jan 27, 2025

In #count, "*" is treated as if it is effectively UINT32_MAX. That was also the intention for #count_with_duplicates (add in #384, not released yet).

Unlike #count, which can assume that * only appears at most once, #count_with_duplicates needs to check each entry.

This means that, e.g:

seqset = SequenceSet["#{UINT32_MAX}:*"]
seqset.count                 => 1
seqset.count_with_duplicates => 1
seqset.count_duplicates      => 0

seqset = SequenceSet["#{UINT32_MAX},*"]
seqset.count                 => 1
seqset.count_with_duplicates => 2
seqset.count_duplicates      => 1

In `#count`, "*" is treated as if it is effectively UINT32_MAX.  That
was also the intention for `#count_with_duplicates`.

Unlike `#count`, which can assume that `*` only appears at most once,
`#count_with_duplicates` needs to check each entry.

This means that, e.g:
   SequenceSet["#{UINT32_MAX}:*"].count_with_duplicates == 1
   SequenceSet["#{UINT32_MAX},*"].count_with_duplicates == 2
@nevans nevans merged commit 63fbdd9 into master Jan 27, 2025
37 checks passed
@nevans nevans deleted the sequence_set-count_duplicates-with-multiple-stars branch January 27, 2025 03:12
@nevans nevans added the bug Something isn't working label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

Successfully merging this pull request may close these issues.

1 participant