# HG changeset patch # User Yuya Nishihara # Date 2018-12-18 13:12:16 # Node ID 247f51cfc66820eaf48a495729c52a4e21a527ca # Parent 86f0ed7ac6886f978eee3835d2efe4b7fb2f0d8a rust: use .rev() for reverse range Differential Revision: https://phab.mercurial-scm.org/D5450 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 @@ impl MissingAncestors { // TODO heuristics for with_capacity()? let mut missing: Vec = Vec::new(); - for curr in (0..=start).map(|i| start - i) { + for curr in (0..=start).rev() { if revs_visit.is_empty() { break; }