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#append when its @string is nil #376

Merged
merged 2 commits into from
Jan 17, 2025
Merged

Conversation

nevans
Copy link
Collaborator

@nevans nevans commented Jan 17, 2025

When a SequenceSet is not normalized, it stores its string in @string. When it is normalized, @string is still used as a cache for @string.

When @string isn't set, but the sequence set is not empty, #append would generate the normalized string after adding the new numbers, and then append the new numbers to the end of the string. For example:

SequenceSet.new.append(5).append(1).string
# in net-imap v0.5.5 => "1,5,1"
# with this bugfix   => "1,5"

This PR forces the string to be generated prior to adding the new numbers, so they can be appended to the end.

@nevans nevans added the bug Something isn't working label Jan 17, 2025
@nevans nevans merged commit a01a59f into master Jan 17, 2025
22 checks passed
@nevans nevans deleted the seqset-bugfixes branch January 17, 2025 13:51
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