-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
fix: do not skip last char when decompressing text where the last chars are uncompressed #360
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…racters are uncompressed
Size Change: +10 B (+0.02%) Total Size: 49.3 kB
ℹ️ View Unchanged
|
github-actions bot
pushed a commit
that referenced
this pull request
Feb 17, 2025
## [3.0.1](v3.0.0...v3.0.1) (2025-02-17) ### Bug Fixes * do not skip last char when decompressing text where the last characters are uncompressed ([#360](#360)) ([30bea44](30bea44))
🎉 This PR is included in version 3.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Compressed text is not 100% compressed. It's a mix of compressed and uncompressed text. The compression mode switches between parsing compressed and uncompressed bytes using a 0x00 byte.
There was a bug where the last character was accidentally skipped when it was uncompressed. The root cause was that the number of remaining characters was not calculated correctly and it was assumed that the one char shorter than it actually was.
With this PR, the decompress code should be easier to read and it is more obvious when the
curPos
variable is incremented. The performance is slightly worse as we read some bytes twice. But I think we can ignore that aspect here.