Skip to content

Commit 403d18f

Browse files
anforowiczokaneco
andauthored
Use an extra assert! to avoid bounds checks.
This change has been suggested by @okaneco in #414 (comment) - thanks! Co-authored-by: Collyn O'Kane <[email protected]>
1 parent f5021fb commit 403d18f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/filter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ mod simd {
119119
prev_row = &prev_row[3..];
120120
curr_row = &mut curr_row[3..];
121121
}
122+
assert!(prev_row.len() >= 3 && curr_row.len() >= 3);
122123
// Can't use `u8x4::from_slice` for the last `[u8;3]`.
123124
let b = load3(prev_row);
124125
let mut x = load3(curr_row);

0 commit comments

Comments
 (0)