diff --git a/backend/src/Model/RingBuffer.ts b/backend/src/Model/RingBuffer.ts index 7b07bcb..1f74806 100644 --- a/backend/src/Model/RingBuffer.ts +++ b/backend/src/Model/RingBuffer.ts @@ -62,9 +62,11 @@ export class RingBuffer { } private dropFirst() { - const freedSpace = this.items[this.start].length - this.usage -= freedSpace + const firstItem = this.items[this.start] delete this.items[this.start] this.start += 1 + + const freedSpace = firstItem.length + this.usage -= freedSpace } }