File tree Expand file tree Collapse file tree 1 file changed +0
-4
lines changed
compiler/rustc_data_structures/src/binary_search_util Expand file tree Collapse file tree 1 file changed +0
-4
lines changed Original file line number Diff line number Diff line change @@ -14,18 +14,14 @@ where
1414 let start = data. partition_point ( |x| key_fn ( x) < * key) ;
1515 // At this point `start` either points at the first entry with equal or
1616 // greater key or is equal to `size` in case all elements have smaller keys
17- // Invariant: start == size || key_fn(&data[start]) >= *key
1817 if start == size || key_fn ( & data[ start] ) != * key {
1918 return & [ ] ;
2019 } ;
21- // Invariant: start < size && key_fn(&data[start]) == *key
2220
2321 // Find the first entry with key > `key`. Skip `start` entries since
2422 // key_fn(&data[start]) == *key
25- // Invariant: offset == size || key_fn(&data[offset]) >= *key
2623 let offset = start + 1 ;
2724 let end = data[ offset..] . partition_point ( |x| key_fn ( x) <= * key) + offset;
28- // Invariant: end == size || key_fn(&data[end]) > *key
2925
3026 & data[ start..end]
3127}
You can’t perform that action at this time.
0 commit comments