Remove result from anchor cmp functions

Co-authored-by: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Keith Simmons 2022-03-24 11:48:31 -07:00
parent ab631cf6c3
commit 92c7b5d6ef
11 changed files with 68 additions and 141 deletions

View file

@ -1813,20 +1813,12 @@ impl BufferSnapshot {
})
.map(move |(replica_id, set)| {
let start_ix = match set.selections.binary_search_by(|probe| {
probe
.end
.cmp(&range.start, self)
.unwrap()
.then(Ordering::Greater)
probe.end.cmp(&range.start, self).then(Ordering::Greater)
}) {
Ok(ix) | Err(ix) => ix,
};
let end_ix = match set.selections.binary_search_by(|probe| {
probe
.start
.cmp(&range.end, self)
.unwrap()
.then(Ordering::Less)
probe.start.cmp(&range.end, self).then(Ordering::Less)
}) {
Ok(ix) | Err(ix) => ix,
};