Skip to content

Commit

Permalink
Remove int64max
Browse files Browse the repository at this point in the history
  • Loading branch information
JOOHOJANG committed Nov 8, 2024
1 parent 341875c commit 2795800
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions packages/sdk/src/document/time/version_vector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,18 @@ export class VersionVector {
/**
* `minLamport` returns min lamport value from vector
*/
public minLamport() {
public minLamport(): bigint {
if (this.vector.size === 0) {
return BigInt(0);
}

// 2^63-1
let min = 9223372036854775807n;

let min: bigint | undefined;
for (const [, lamport] of this) {
if (lamport < min) {
if (min === undefined || lamport < min) {
min = lamport;
}
}

return min;
return min as bigint;
}

/**
Expand Down

0 comments on commit 2795800

Please sign in to comment.