Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/apply-gc' into apply-gc
Browse files Browse the repository at this point in the history
  • Loading branch information
raararaara committed May 23, 2024
2 parents 5750dbe + a5ebd2f commit 9bb9a91
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/document/crdt/root.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export class CRDTRoot {
this.registerRemovedElement(elem);
}
if (elem instanceof CRDTText || elem instanceof CRDTTree) {
for (const pair of elem.GCPairs()) {
for (const pair of elem.getGCPairs()) {
this.registerGCPair(pair);
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/document/crdt/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,9 @@ export class CRDTTextValue {
}

/**
* `GCPairs` returns the pairs of GC.
* `getGCPairs` returns the pairs of GC.
*/
public GCPairs(): Array<GCPair> {
public getGCPairs(): Array<GCPair> {
const pairs = [];

for (const node of this.attributes) {
Expand Down Expand Up @@ -464,16 +464,16 @@ export class CRDTText<A extends Indexable = Indexable> extends CRDTElement {
}

/**
* `GCPairs` returns the pairs of GC.
* `getGCPairs` returns the pairs of GC.
*/
public GCPairs(): Array<GCPair> {
public getGCPairs(): Array<GCPair> {
const pairs = [];
for (const node of this.rgaTreeSplit) {
if (node.getRemovedAt()) {
pairs.push({ parent: this.rgaTreeSplit, child: node });
}

for (const p of node.getValue().GCPairs()) {
for (const p of node.getValue().getGCPairs()) {
pairs.push(p);
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/document/crdt/tree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,9 +668,9 @@ export class CRDTTreeNode
}

/**
* `GCPairs` returns the pairs of GC.
* `getGCPairs` returns the pairs of GC.
*/
public GCPairs(): Array<GCPair> {
public getGCPairs(): Array<GCPair> {
const pairs: Array<GCPair> = [];
if (!this.attrs) {
return pairs;
Expand Down Expand Up @@ -1217,16 +1217,16 @@ export class CRDTTree extends CRDTElement implements GCParent {
}

/**
* `GCPairs` returns the pairs of GC.
* `getGCPairs` returns the pairs of GC.
*/
public GCPairs(): Array<GCPair> {
public getGCPairs(): Array<GCPair> {
const pairs: Array<GCPair> = [];
this.indexTree.traverse((node) => {
if (node.getRemovedAt()) {
pairs.push({ parent: this, child: node });
}

for (const p of node.GCPairs()) {
for (const p of node.getGCPairs()) {
pairs.push(p);
}
});
Expand Down

0 comments on commit 9bb9a91

Please sign in to comment.