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_
> > +// 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 = {
> > +
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.
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
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)?
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
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
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
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
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
10 matches
Mail list logo