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

login
register
mail settings
Submitter phabricator
Date Jan. 3, 2019, 10:53 p.m.
Message ID <813a7dd202d5bcdd2a66ce4255bb9509@localhost.localdomain>
Download mbox | patch
Permalink /patch/37444/
State Not Applicable
Headers show

Comments

phabricator - Jan. 3, 2019, 10:53 p.m.
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




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

Patch

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;
             }