[Commented On] D9656: copies-rust: use imrs::OrdSet instead of imrs::HashSet

baymax (Baymax, Your Personal Patch-care Companion) phabricator at mercurial-scm.org
Mon Feb 22 22:12:59 UTC 2021


baymax added a comment.
baymax updated this revision to Diff 25799.


  ✅ refresh by Heptapod after a successful CI run (🐙 💚)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D9656?vs=25760&id=25799

BRANCH
  default

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

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

AFFECTED FILES
  rust/hg-core/src/copy_tracing.rs

CHANGE DETAILS

diff --git a/rust/hg-core/src/copy_tracing.rs b/rust/hg-core/src/copy_tracing.rs
--- a/rust/hg-core/src/copy_tracing.rs
+++ b/rust/hg-core/src/copy_tracing.rs
@@ -6,10 +6,10 @@
 use im_rc::ordmap::DiffItem;
 use im_rc::ordmap::Entry;
 use im_rc::ordmap::OrdMap;
+use im_rc::OrdSet;
 
 use std::cmp::Ordering;
 use std::collections::HashMap;
-use std::collections::HashSet;
 use std::convert::TryInto;
 
 pub type PathCopies = HashMap<HgPathBuf, HgPathBuf>;
@@ -25,7 +25,7 @@
     path: Option<PathToken>,
     /// a set of previous `CopySource.rev` value directly or indirectly
     /// overwritten by this one.
-    overwritten: HashSet<Revision>,
+    overwritten: OrdSet<Revision>,
 }
 
 impl CopySource {
@@ -36,7 +36,7 @@
         Self {
             rev,
             path,
-            overwritten: HashSet::new(),
+            overwritten: OrdSet::new(),
         }
     }
 
@@ -45,7 +45,7 @@
     /// Use this when merging two InternalPathCopies requires active merging of
     /// some entries.
     fn new_from_merge(rev: Revision, winner: &Self, loser: &Self) -> Self {
-        let mut overwritten = HashSet::new();
+        let mut overwritten = OrdSet::new();
         overwritten.extend(winner.overwritten.iter().copied());
         overwritten.extend(loser.overwritten.iter().copied());
         overwritten.insert(winner.rev);



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


More information about the Mercurial-patches mailing list