Merge pull request #16060 from Microsoft/remove-remove

Use `orderedRemoveItem` instead of `remove` helper
This commit is contained in:
Andy 2017-05-24 09:15:42 -07:00 committed by GitHub
commit f6ff8dd64f

View file

@ -13,13 +13,6 @@ namespace ts.server {
External
}
function remove<T>(items: T[], item: T) {
const index = items.indexOf(item);
if (index >= 0) {
items.splice(index, 1);
}
}
function countEachFileTypes(infos: ScriptInfo[]): { js: number, jsx: number, ts: number, tsx: number, dts: number } {
const result = { js: 0, jsx: 0, ts: 0, tsx: 0, dts: 0 };
for (const info of infos) {
@ -732,7 +725,7 @@ namespace ts.server {
// remove a root file from project
protected removeRoot(info: ScriptInfo): void {
remove(this.rootFiles, info);
orderedRemoveItem(this.rootFiles, info);
this.rootFilesMap.remove(info.path);
}
}