D5416: rust: translation of missingancestors

2018-12-19 Thread yuja (Yuya Nishihara)
yuja added a comment. > > +// in Rust, one can't just use mutable variables assignation > > +// to be more straightforward. Instead of Python's > > +// thisvisit and othervisit, we'll differentiate with a boolean > > +let this_

Re: D5416: rust: translation of missingancestors

2018-12-19 Thread Yuya Nishihara
> > +// in Rust, one can't just use mutable variables assignation > > +// to be more straightforward. Instead of Python's > > +// thisvisit and othervisit, we'll differentiate with a > boolean > > +let this_visit_is_revs = { > > +

D5416: rust: translation of missingancestors

2018-12-14 Thread gracinet (Georges Racinet)
This revision was automatically updated to reflect the committed changes. gracinet marked an inline comment as done. Closed by commit rHG5817c3b186a7: rust: translation of missingancestors (authored by gracinet, committed by ). REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.

D5416: rust: translation of missingancestors

2018-12-14 Thread yuja (Yuya Nishihara)
yuja added a comment. Queued this, thanks. > +/// Add rev's parents to self.bases > +#[inline] > +fn add_parents(&mut self, rev: Revision) -> Result<(), GraphError> { > +// No need to bother the set with inserting NULL_REVISION over and > +// over

Re: D5416: rust: translation of missingancestors

2018-12-14 Thread Yuya Nishihara
Queued this, thanks. > +/// Add rev's parents to self.bases > +#[inline] > +fn add_parents(&mut self, rev: Revision) -> Result<(), GraphError> { > +// No need to bother the set with inserting NULL_REVISION over and > +// over > +for p in self.graph.parents(rev)?

D5416: rust: translation of missingancestors

2018-12-14 Thread gracinet (Georges Racinet)
gracinet marked 2 inline comments as done. gracinet added a comment. Thanks for the useful tips! INLINE COMMENTS > kevincox wrote in ancestors.rs:154 > Why not just write: > > self.bases.iter().any(|b| != NULL_REVISION) > > It is much clearer what you mean and I suspect the performance is

D5416: rust: translation of missingancestors

2018-12-14 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 12855. gracinet marked an inline comment as done. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5416?vs=12832&id=12855 REVISION DETAIL https://phab.mercurial-scm.org/D5416 AFFECTED FILES rust/hg-core/src/ancesto

D5416: rust: translation of missingancestors

2018-12-12 Thread kevincox (Kevin Cox)
kevincox added inline comments. INLINE COMMENTS > ancestors.rs:154 > +_ => true, > +} > +} Why not just write: self.bases.iter().any(|b| != NULL_REVISION) It is much clearer what you mean and I suspect the performance is very similar. See the below example. If you wa

D5416: rust: translation of missingancestors

2018-12-12 Thread gracinet (Georges Racinet)
gracinet updated this revision to Diff 12832. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D5416?vs=12829&id=12832 REVISION DETAIL https://phab.mercurial-scm.org/D5416 AFFECTED FILES rust/hg-core/src/ancestors.rs rust/hg-core/src/lib.rs tests/tes

D5416: rust: translation of missingancestors

2018-12-12 Thread gracinet (Georges Racinet)
gracinet created this revision. Herald added subscribers: mercurial-devel, mjpieters, kevincox, durin42. Herald added a reviewer: hg-reviewers. REVISION SUMMARY This is as direct as possible a translation of the ancestor.missingancestors Python class in pure Rust. The goal for this changeset i