Skip to content

Commit f6ff8dd

Browse files
author
Andy
authored
Merge pull request #16060 from Microsoft/remove-remove
Use `orderedRemoveItem` instead of `remove` helper
2 parents b4ee6b1 + 34bb955 commit f6ff8dd

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/server/project.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ namespace ts.server {
1313
External
1414
}
1515

16-
function remove<T>(items: T[], item: T) {
17-
const index = items.indexOf(item);
18-
if (index >= 0) {
19-
items.splice(index, 1);
20-
}
21-
}
22-
2316
function countEachFileTypes(infos: ScriptInfo[]): { js: number, jsx: number, ts: number, tsx: number, dts: number } {
2417
const result = { js: 0, jsx: 0, ts: 0, tsx: 0, dts: 0 };
2518
for (const info of infos) {
@@ -732,7 +725,7 @@ namespace ts.server {
732725

733726
// remove a root file from project
734727
protected removeRoot(info: ScriptInfo): void {
735-
remove(this.rootFiles, info);
728+
orderedRemoveItem(this.rootFiles, info);
736729
this.rootFilesMap.remove(info.path);
737730
}
738731
}

0 commit comments

Comments
 (0)