-
Notifications
You must be signed in to change notification settings - Fork 3
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
Remove double bounds check #77
Conversation
Codecov ReportAttention: Patch coverage is
|
let index = zvec - s.base[gBase as usize][zn as usize]; | ||
nextSym = match s.perm[gPerm as usize].get(index as usize) { | ||
Some(&nextSym) => nextSym, | ||
None => error!(BZ_DATA_ERROR), | ||
}; |
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.
the s.perm[i]
arrays are 258
elements long, so the check for the index
value to be in bounds was happening twice (though of course llvm might optimize that out)
match uc { | ||
0x17 => current_block = BZ_X_ENDHDR_2, | ||
0x31 => current_block = BZ_X_BLKHDR_2, | ||
_ => error!(BZ_DATA_ERROR), | ||
}; |
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.
this is just a cleanup that i spotted
groupNo = -1; | ||
groupPos = 0; |
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.
moved over to hopefully make it clearer why groupNo
cannot be unsigned (currently anyway, maybe with some extra refactoring).
No description provided.