mirror of
https://github.com/wavetermdev/xterm.js.git
synced 2026-08-05 13:43:48 -07:00
slightly faster trimAndRecycle
This commit is contained in:
@@ -119,10 +119,7 @@ export class CircularList<T> extends EventEmitter implements ICircularList<T> {
|
||||
}
|
||||
|
||||
public trimAndRecycle(): T | undefined {
|
||||
this._startIndex++;
|
||||
if (this._startIndex === this._maxLength) {
|
||||
this._startIndex = 0;
|
||||
}
|
||||
this._startIndex = ++this._startIndex % this._maxLength;
|
||||
this.emit('trim', 1);
|
||||
return this._array[this._getCyclicIndex(this._length - 1)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user