-
Notifications
You must be signed in to change notification settings - Fork 1
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
use random access indexing in huffman::table::find #101
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
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #101 +/- ##
==========================================
+ Coverage 82.08% 82.21% +0.13%
==========================================
Files 17 17
Lines 625 624 -1
Branches 37 37
==========================================
Hits 513 513
Misses 94 94
+ Partials 18 17 -1 ☔ View full report in Codecov by Sentry. |
oliverlee
force-pushed
the
Ic736c4d2e0150e53bd7bf1870104462294368a5c
branch
2 times, most recently
from
October 7, 2023 03:43
a4795ec
to
2fb547f
Compare
oliverlee
force-pushed
the
I5597dc51ea5e9f086c71e2f9396fccd5ace923b2
branch
from
October 7, 2023 03:43
4ed4fa6
to
cbb5d82
Compare
garymm
force-pushed
the
I5597dc51ea5e9f086c71e2f9396fccd5ace923b2
branch
from
October 13, 2023 02:48
cbb5d82
to
c6c647a
Compare
garymm
force-pushed
the
Ic736c4d2e0150e53bd7bf1870104462294368a5c
branch
from
October 13, 2023 02:52
2fb547f
to
f041213
Compare
garymm
approved these changes
Oct 13, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥
oliverlee
force-pushed
the
I5597dc51ea5e9f086c71e2f9396fccd5ace923b2
branch
4 times, most recently
from
November 21, 2023 20:08
200b3ef
to
c72bc7d
Compare
Base automatically changed from
I5597dc51ea5e9f086c71e2f9396fccd5ace923b2
to
master
November 21, 2023 20:17
All DEFLATE canonical codes of a given bitsize are lexicographically consecutive values in the same order as the symbols they represent. As a result, the skip field for the first code of a given bitsize can be used to determine if an input code exists in the table in constant time. This commit replaces the linear time search of all codes of a given bitsize in huffman::table::find. Instead, the find method does the following: * if the input code bitsize is greater than the iterator code bitsize, advance the iterator by the iterator skip field * if the input code bitsize is less than the iterator code bitsize, return the iterator as an error * if the input code bitsize is equal to the iterator code bitsize: - determine the distance from the iterator code value to the input code value. If it is less than the iterator skip field, advance the iterator by the calculated distance and return the iterator as a success; otherwise - advance the iterator by the iterator skip field and continue resolves #90 Change-Id: Ic736c4d2e0150e53bd7bf1870104462294368a5c
oliverlee
force-pushed
the
Ic736c4d2e0150e53bd7bf1870104462294368a5c
branch
from
January 6, 2024 17:58
f041213
to
e343fbf
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in 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.
All DEFLATE canonical codes of a given bitsize are lexicographically
consecutive values in the same order as the symbols they represent. As
a result, the skip field for the first code of a given bitsize can be
used to determine if an input code exists in the table in constant time.
This commit replaces the linear time search of all codes of a given
bitsize in huffman::table::find. Instead, the find method does the
following:
advance the iterator by the iterator skip field
return the iterator as an error
code value. If it is less than the iterator skip field, advance the
iterator by the calculated distance and return the iterator as a
success; otherwise
resolves #90
Change-Id: Ic736c4d2e0150e53bd7bf1870104462294368a5c