Remove removeWhere (#19082)

This commit is contained in:
Andy
2017-10-10 15:52:41 -07:00
committed by GitHub
parent 61dd815ebc
commit d086b637c5

View File

@@ -356,21 +356,6 @@ namespace ts {
return array;
}
export function removeWhere<T>(array: T[], f: (x: T) => boolean): boolean {
let outIndex = 0;
for (const item of array) {
if (!f(item)) {
array[outIndex] = item;
outIndex++;
}
}
if (outIndex !== array.length) {
array.length = outIndex;
return true;
}
return false;
}
export function filterMutate<T>(array: T[], f: (x: T, i: number, array: T[]) => boolean): void {
let outIndex = 0;
for (let i = 0; i < array.length; i++) {