We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3f40996 commit ec6f3d5Copy full SHA for ec6f3d5
packages/sds/src/message_channel/mem_local_history.ts
@@ -48,12 +48,8 @@ export class MemLocalHistory {
48
49
// Let's drop older messages if max length is reached
50
if (this.length > this.maxLength) {
51
- // TODO: Would it be faster to reverse, pop, reverse?
52
const numItemsToRemove = this.length - this.maxLength;
53
- const timestampCutoff = this.items[numItemsToRemove - 1].lamportTimestamp;
54
- this.items = this.items.filter(
55
- (m) => m.lamportTimestamp > timestampCutoff
56
- );
+ this.items.splice(0, numItemsToRemove);
57
}
58
59
return this.items.length;
0 commit comments