about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2015-08-21 14:47:02 -0400
committerNiko Matsakis <niko@alum.mit.edu>2015-08-21 14:47:40 -0400
commit57909f7068c5a2fb63f15bc43a7d3e823205608a (patch)
tree8ab6f583c4c6885ff781741f106f8cde176dcc35
parent63eedfcf536f02e09e7dca7290b803ad8aa243f9 (diff)
downloadrust-57909f7068c5a2fb63f15bc43a7d3e823205608a.tar.gz
rust-57909f7068c5a2fb63f15bc43a7d3e823205608a.zip
move the reverse into the iterator
-rw-r--r--src/librustc_data_structures/transitive_relation.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/librustc_data_structures/transitive_relation.rs b/src/librustc_data_structures/transitive_relation.rs
index 9d99f77deb9..728137f4ae9 100644
--- a/src/librustc_data_structures/transitive_relation.rs
+++ b/src/librustc_data_structures/transitive_relation.rs
@@ -211,7 +211,7 @@ impl<T:Debug+PartialEq> TransitiveRelation<T> {
             //    - In the example above, we would reverse to
             //      `[z, y, x]` and then pare down to `[z]`.
             // 4. Reverse once more just so that we yield a vector in
-            //    increasing order of index. Maybe this is silly.
+            //    increasing order of index. Not necessary, but why not.
             //
             // I believe this algorithm yields a minimal set. The
             // argument is that, after step 2, we know that no element
@@ -224,11 +224,11 @@ impl<T:Debug+PartialEq> TransitiveRelation<T> {
             pare_down(&mut candidates, closure); // (2)
             candidates.reverse(); // (3a)
             pare_down(&mut candidates, closure); // (3b)
-            candidates.reverse(); // (4)
             candidates
         });
 
         lub_indices.into_iter()
+                   .rev() // (4)
                    .map(|i| &self.elements[i])
                    .collect()
     }