Skip to content

Commit

Permalink
remove extra check
Browse files Browse the repository at this point in the history
  • Loading branch information
Manishearth committed Sep 30, 2024
1 parent c17611e commit f00a1d8
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions utils/zerovec/src/varzerovec/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,16 +563,13 @@ where
predicate: impl FnMut(&T) -> Ordering,
range: Range<usize>,
) -> Option<Result<usize, usize>> {
if range.start > self.len() {
return None;
}
if range.end > self.len() {
return None;
}
if range.end < range.start {
return None;
}
// Safety: We bounds checked above
// Safety: We bounds checked above: end is in-bounds or len, and start is <= end
let range_absolute =
unsafe { self.binary_search_in_range_unchecked(predicate, range.clone()) };
// The values returned are relative to the range start
Expand Down

0 comments on commit f00a1d8

Please sign in to comment.