This commit is contained in:
Daniel Imms
2016-11-27 03:27:36 -08:00
parent 61fbbb0054
commit 607c819109
4 changed files with 115 additions and 105 deletions
+5
View File
@@ -93,6 +93,11 @@ export class CircularList<T> {
return this._array[this._getCyclicIndex(this._length-- - 1)];
}
public removeItemsFromStart(amount: number): void {
this._startIndex += this._length -amount;
this._length = amount;
}
// TODO: Warn there's no error handling and that this is a slow operation
public splice(start: number, deleteCount: number, ...items: T[]) {
if (deleteCount) {