File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed
Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,6 @@ impl ReplicaId {
2020 pub const REMOTE_SERVER : ReplicaId = ReplicaId ( 1 ) ;
2121 /// The agent's unique identifier.
2222 pub const AGENT : ReplicaId = ReplicaId ( 2 ) ;
23- /// A local branch.
24- pub const LOCAL_BRANCH : ReplicaId = ReplicaId ( 3 ) ;
2523 /// The first collaborative replica ID, any replica equal or greater than this is a collaborative replica.
2624 pub const FIRST_COLLAB_ID : ReplicaId = ReplicaId ( 8 ) ;
2725
@@ -46,8 +44,6 @@ impl fmt::Debug for ReplicaId {
4644 write ! ( f, "<remote>" )
4745 } else if * self == ReplicaId :: AGENT {
4846 write ! ( f, "<agent>" )
49- } else if * self == ReplicaId :: LOCAL_BRANCH {
50- write ! ( f, "<branch>" )
5147 } else {
5248 write ! ( f, "{}" , self . 0 )
5349 }
Original file line number Diff line number Diff line change @@ -1862,8 +1862,11 @@ impl BufferSnapshot {
18621862 S : ToOffset ,
18631863 T : Into < Arc < str > > ,
18641864 {
1865- let mut lamport_clock = clock:: Lamport :: new ( ReplicaId :: LOCAL_BRANCH ) ;
1866- let timestamp = lamport_clock. tick ( ) ;
1865+ let mut timestamp = clock:: Lamport {
1866+ replica_id : self . replica_id ,
1867+ value : self . version . get ( self . replica_id ) ,
1868+ } ;
1869+ let timestamp = timestamp. tick ( ) ;
18671870 let edits: Vec < _ > = edits
18681871 . into_iter ( )
18691872 . map ( |( range, new_text) | ( range. to_offset ( self ) , new_text. into ( ) ) )
You can’t perform that action at this time.
0 commit comments