Skip to content

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
@nevans nevans added the sequence-set Any code the IMAP `sequence-set` data type or grammar rule, especially the SequenceSet class. label Dec 10, 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 sequence-set Any code the IMAP `sequence-set` data type or grammar rule, especially the SequenceSet class.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants