]> git.proxmox.com Git - rustc.git/blobdiff - src/librustc_data_structures/transitive_relation.rs
New upstream version 1.46.0~beta.2+dfsg1
[rustc.git] / src / librustc_data_structures / transitive_relation.rs
index de503fe8228aaa87d004b5bf4cfed82e49a63108..189da3395ad1b32999e43db90bd67b6e1ebc33f9 100644 (file)
@@ -391,14 +391,12 @@ impl<T: Clone + Debug + Eq + Hash> TransitiveRelation<T> {
 /// - Input: `[a, x, b, y]`. Output: `[a, x]`.
 fn pare_down(candidates: &mut Vec<usize>, closure: &BitMatrix<usize, usize>) {
     let mut i = 0;
-    while i < candidates.len() {
-        let candidate_i = candidates[i];
+    while let Some(&candidate_i) = candidates.get(i) {
         i += 1;
 
         let mut j = i;
         let mut dead = 0;
-        while j < candidates.len() {
-            let candidate_j = candidates[j];
+        while let Some(&candidate_j) = candidates.get(j) {
             if closure.contains(candidate_i, candidate_j) {
                 // If `i` can reach `j`, then we can remove `j`. So just
                 // mark it as dead and move on; subsequent indices will be