-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reuse
State::U32
for verification of PNG signature.
This way removes a separate `State::Signature` variant and handles the PNG signature via two `State::U32` states. This is desirable because: * This helps to reuse the performance gains for `State::U32` (i.e. avoid accumulating the signature byte-by-byte if the input buffer already has all its bytes) * Avoiding separate code also has additional benefits: - Less pressure on the instructions cache - Ability to reuse branch prediction for `U32`-related code The modified code already has reasonable test coverage via http://www.schaik.com/pngsuite/#corrupted
- Loading branch information
1 parent
927498d
commit 92a7e4f
Showing
1 changed file
with
28 additions
and
19 deletions.
There are no files selected for viewing
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