[Updated] D9307: copies-rust: parse the changed-file sidedata directly in rust

SimonSapin phabricator at mercurial-scm.org
Tue Dec 1 09:10:48 UTC 2020


SimonSapin added a comment.
SimonSapin accepted this revision.


  Looks good to me!

INLINE COMMENTS

> copy_tracing.rs:206
> +        while low_part < high_part {
> +            let cursor = (low_part + high_part - 1) / 2;
> +            let (flags, filename, _source) = self.entry(cursor);

Is this a binary search? Given that off by ones are notoriously easy it’d be nice to use https://doc.rust-lang.org/std/primitive.slice.html#method.binary_search_by_key instead of making our own. But that only searches in slices while `self.entry()` here works with integer indices, so never mind.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D9307/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D9307

To: marmoute, #hg-reviewers, Alphare, SimonSapin
Cc: SimonSapin, Alphare, mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercurial-scm.org/pipermail/mercurial-patches/attachments/20201201/fb00a2e1/attachment.html>


More information about the Mercurial-patches mailing list