@@ -28,7 +28,7 @@ export class PatchLog implements Printable {
28
28
* Model factory function that creates a new JSON CRDT model instance, which
29
29
* is used as the starting point of the log. It is called every time a new
30
30
* model is needed to replay the log.
31
- *
31
+ *
32
32
* @readonly Internally this function may be updated, but externally it is
33
33
* read-only.
34
34
*/
@@ -37,7 +37,7 @@ export class PatchLog implements Printable {
37
37
/**
38
38
* The end of the log, the current state of the document. It is the model
39
39
* instance that is used to apply new patches to the log.
40
- *
40
+ *
41
41
* @readonly
42
42
*/
43
43
public readonly end : Model ;
@@ -46,7 +46,7 @@ export class PatchLog implements Printable {
46
46
* The patches in the log, stored in an AVL tree for efficient replaying. The
47
47
* collection of patches which are applied to the `start()` model to reach
48
48
* the `end` model.
49
- *
49
+ *
50
50
* @readonly
51
51
*/
52
52
public readonly patches = new AvlMap < ITimestampStruct , Patch > ( compare ) ;
@@ -56,7 +56,7 @@ export class PatchLog implements Printable {
56
56
57
57
constructor ( start : ( ) => Model ) {
58
58
this . start = start ;
59
- const end = this . end = start ( ) ;
59
+ const end = ( this . end = start ( ) ) ;
60
60
const onPatch = ( patch : Patch ) => {
61
61
const id = patch . getId ( ) ;
62
62
if ( ! id ) return ;
@@ -114,7 +114,7 @@ export class PatchLog implements Printable {
114
114
*/
115
115
public advanceTo ( ts : ITimestampStruct ) : void {
116
116
const newStartPatches : Patch [ ] = [ ] ;
117
- let node = first ( this . patches . root )
117
+ let node = first ( this . patches . root ) ;
118
118
for ( ; node && compare ( ts , node . k ) >= 0 ; node = next ( node ) ) newStartPatches . push ( node . v ) ;
119
119
for ( const patch of newStartPatches ) this . patches . del ( patch . getId ( ) ! ) ;
120
120
const oldStart = this . start ;
0 commit comments