mirror of
https://github.com/martinvonz/jj.git
synced 2025-01-03 18:24:19 +00:00
backend: allow cheap copy of MillisSinceEpoch(i64)
It's unlikely this type will become uncopyable.
This commit is contained in:
parent
ebf90384f6
commit
e588a9babc
4 changed files with 4 additions and 5 deletions
|
@ -39,7 +39,7 @@ id_type!(pub FileId);
|
|||
id_type!(pub SymlinkId);
|
||||
id_type!(pub ConflictId);
|
||||
|
||||
#[derive(ContentHash, Debug, PartialEq, Eq, Clone, PartialOrd, Ord)]
|
||||
#[derive(ContentHash, Debug, PartialEq, Eq, Clone, Copy, PartialOrd, Ord)]
|
||||
pub struct MillisSinceEpoch(pub i64);
|
||||
|
||||
#[derive(ContentHash, Debug, PartialEq, Eq, Clone, PartialOrd, Ord)]
|
||||
|
|
|
@ -950,7 +950,7 @@ impl<'index> EvaluationContext<'index> {
|
|||
let make_rev_item = |entry: IndexEntry<'_>| {
|
||||
let commit = self.store.get_commit(&entry.commit_id()).unwrap();
|
||||
Reverse(Item {
|
||||
timestamp: commit.committer().timestamp.timestamp.clone(),
|
||||
timestamp: commit.committer().timestamp.timestamp,
|
||||
pos: entry.position(),
|
||||
})
|
||||
};
|
||||
|
|
|
@ -1876,8 +1876,7 @@ mod tests {
|
|||
commit2.committer.timestamp.timestamp
|
||||
);
|
||||
// The rest of the commit should be the same
|
||||
actual_commit2.committer.timestamp.timestamp =
|
||||
commit2.committer.timestamp.timestamp.clone();
|
||||
actual_commit2.committer.timestamp.timestamp = commit2.committer.timestamp.timestamp;
|
||||
assert_eq!(actual_commit2, commit2);
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ where
|
|||
return Ok(op_head.clone());
|
||||
}
|
||||
|
||||
op_heads.sort_by_key(|op| op.metadata().end_time.timestamp.clone());
|
||||
op_heads.sort_by_key(|op| op.metadata().end_time.timestamp);
|
||||
let new_op = resolver(op_heads)?;
|
||||
let mut old_op_heads = ancestor_op_heads;
|
||||
old_op_heads.extend_from_slice(new_op.parent_ids());
|
||||
|
|
Loading…
Reference in a new issue