Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 97bc528

Browse files
Remove invariant comments
1 parent 9ced089 commit 97bc528

File tree

1 file changed

+0
-4
lines changed
  • compiler/rustc_data_structures/src/binary_search_util

1 file changed

+0
-4
lines changed

‎compiler/rustc_data_structures/src/binary_search_util/mod.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /