Skip to content

Commit

Permalink
chore(json-crdt-extensions): 🤖 cleanup Point class
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Apr 19, 2024
1 parent 0a5748c commit 5cdefcd
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/json-crdt-extensions/peritext/point/Point.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ export class Point<T = string> implements Pick<Stateful, 'refresh'>, Printable {
* @returns Returns 0 if the two points are equal, -1 if this point is less
* than the other point, and 1 if this point is greater than the other
* point.
*
* @todo Rename to `cmp`.
*/
public cmp(other: Point<T>): -1 | 0 | 1 {
const cmp = compare(this.id, other.id);
Expand All @@ -76,8 +74,6 @@ export class Point<T = string> implements Pick<Stateful, 'refresh'>, Printable {
* @returns Returns 0 if the two points are equal, negative if this point is
* less than the other point, and positive if this point is greater
* than the other point.
*
* @todo Rename to `cmpSpatial`.
*/
public cmpSpatial(other: Point<T>): number {
const thisId = this.id;
Expand Down Expand Up @@ -135,15 +131,6 @@ export class Point<T = string> implements Pick<Stateful, 'refresh'>, Printable {
return pos + this.id.time - chunk.id.time;
}

private _pos: number = -1;

/** @todo Is this needed? */
public posCached(): number {
if (this._pos >= 0) return this._pos;
const pos = (this._pos = this.pos());
return pos;
}

/**
* @returns Returns the view position of the point, as if it is a caret in
* the text pointing between characters.
Expand Down

0 comments on commit 5cdefcd

Please sign in to comment.