-
-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify safety checks in
inv_memchr
, LOOP_SIZE
-stepping loop.
Before this commit the safety of `end_ptr.sub(loop_size)` depended on a somewhat remote and indirect reasoning that `haystack.len() >= LOOP_SIZE` if `loop_size == LOOP_SIZE` (that reasoning was based on having `let loop_size = cmp::min(LOOP_SIZE, haystack.len())`). After this commit, the safety checks are done in an `if` statement right above where `end_ptr.sub(LOOP_SIZE)` happens. This simplification also allowed removing the `loop_size` binding/variable.
- Loading branch information
1 parent
41f8bdb
commit 8f3d10a
Showing
1 changed file
with
32 additions
and
24 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