D5450: rust: use .rev() for reverse range

yuja (Yuya Nishihara) phabricator at mercurial-scm.org
Thu Jan 3 22:53:57 UTC 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHG247f51cfc668: rust: use .rev() for reverse range (authored by yuja, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D5450?vs=12896&id=13001

REVISION DETAIL
  https://phab.mercurial-scm.org/D5450

AFFECTED FILES
  rust/hg-core/src/ancestors.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/ancestors.rs b/rust/hg-core/src/ancestors.rs
--- a/rust/hg-core/src/ancestors.rs
+++ b/rust/hg-core/src/ancestors.rs
@@ -321,7 +321,7 @@
 
         // TODO heuristics for with_capacity()?
         let mut missing: Vec<Revision> = Vec::new();
-        for curr in (0..=start).map(|i| start - i) {
+        for curr in (0..=start).rev() {
             if revs_visit.is_empty() {
                 break;
             }



To: yuja, #hg-reviewers
Cc: durin42, kevincox, mercurial-devel


More information about the Mercurial-devel mailing list