# HG changeset patch # User Pierre-Yves David # Date 2020-04-21 13:13:13 # Node ID 818502d2f5e345a5708a042bba3d91c4638742f6 # Parent c94d013e22997010995eba5657a403b64c6bfeab copies-rust: pre-introduce a PathToken type and use it where applicable Handling string all the time is quite slow. So we are about to use more efficient "token". We do some of the churn early to clarify the next changesets. Differential Revision: https://phab.mercurial-scm.org/D9492 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 @@ -11,17 +11,19 @@ use std::convert::TryInto; pub type PathCopies = HashMap; +type PathToken = HgPathBuf; + #[derive(Clone, Debug, PartialEq)] struct TimeStampedPathCopy { /// revision at which the copy information was added rev: Revision, /// the copy source, (Set to None in case of deletion of the associated /// key) - path: Option, + path: Option, } /// maps CopyDestination to Copy Source (+ a "timestamp" for the operation) -type TimeStampedPathCopies = OrdMap; +type TimeStampedPathCopies = OrdMap; /// hold parent 1, parent 2 and relevant files actions. pub type RevInfo<'a> = (Revision, Revision, ChangedFiles<'a>); @@ -467,7 +469,7 @@ fn merge_copies_dict bool>( changes: &ChangedFiles, oracle: &mut AncestorOracle, - dest: &HgPathBuf, + dest: &PathToken, src_minor: &TimeStampedPathCopy, src_major: &TimeStampedPathCopy, ) -> MergePick {