D5945: rust: itering less on MissingAncestors.bases for max()

2019-02-15 Thread kevincox (Kevin Cox)
kevincox added inline comments. INLINE COMMENTS > ancestors.rs:347 > } > - > -let max_bases = > -bases_visit.iter().cloned().max().unwrap_or(NULL_REVISION); > -let max_revs = > -revs_visit.iter().cloned().max().unwrap_or(NULL_REVISION); > -

D5945: rust: itering less on MissingAncestors.bases for max()

2019-02-15 Thread gracinet (Georges Racinet)
This revision was automatically updated to reflect the committed changes. Closed by commit rHG9060af281be7: rust: itering less on MissingAncestors.bases for max() (authored by gracinet, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5945?vs

D5945: rust: itering less on MissingAncestors.bases for max()

2019-02-13 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 14057. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5945?vs=14046&id=14057 REVISION DETAIL https://phab.mercurial-scm.org/D5945 AFFECTED FILES rust/hg-core/src/ancestors.rs rust/hg-core/src/dagops.rs rust/h

D5945: rust: itering less on MissingAncestors.bases for max()

2019-02-13 Thread gracinet (Georges Racinet)
gracinet added inline comments. INLINE COMMENTS > kevincox wrote in ancestors.rs:41 > If you don't want to depend on the value of NULL_REVISION you can use the > minimum value for the type backing revision. > > Other special revisions shouldn't be relevant because you shouldn't be > comparing

D5945: rust: itering less on MissingAncestors.bases for max()

2019-02-12 Thread kevincox (Kevin Cox)
kevincox added inline comments. INLINE COMMENTS > gracinet wrote in ancestors.rs:41 > I must confess to have hesitated a bit on that one. On one hand, it would > work, but semantically if ever a new "special" revision -2 is introduced, > this could become problematic. On the other hand, there a

D5945: rust: itering less on MissingAncestors.bases for max()

2019-02-12 Thread gracinet (Georges Racinet)
gracinet added inline comments. INLINE COMMENTS > kevincox wrote in ancestors.rs:41 > Does it make sense to just default this to -1 and remove the option? I must confess to have hesitated a bit on that one. On one hand, it would work, but semantically if ever a new "special" revision -2 is intr

D5945: rust: itering less on MissingAncestors.bases for max()

2019-02-12 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 14046. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5945?vs=14042&id=14046 REVISION DETAIL https://phab.mercurial-scm.org/D5945 AFFECTED FILES rust/hg-core/src/ancestors.rs rust/hg-core/src/dagops.rs CHANGE

D5945: rust: itering less on MissingAncestors.bases for max()

2019-02-12 Thread kevincox (Kevin Cox)
kevincox accepted this revision. kevincox added inline comments. INLINE COMMENTS > ancestors.rs:41 > bases: HashSet, > +max_base: Option, > } Does it make sense to just default this to -1 and remove the option? REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.o

D5945: rust: itering less on MissingAncestors.bases for max()

2019-02-12 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added subscribers: mercurial-devel, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Instead of iterating on the whole `self.bases` each time to find its max, we keep the latter in a separate member attribute and keep it up to