mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-09 01:28:50 +01:00
Merge pull request #184919 from CodinGame/remove-side-effect-in-expected-pure-function
Remove side effect from `array.some` callback
This commit is contained in:
@@ -816,15 +816,12 @@ export abstract class BaseExtHostTerminalService extends Disposable implements I
|
||||
}
|
||||
|
||||
private _getTerminalObjectIndexById<T extends ExtHostTerminal>(array: T[], id: ExtHostTerminalIdentifier): number | null {
|
||||
let index: number | null = null;
|
||||
array.some((item, i) => {
|
||||
const thisId = item._id;
|
||||
if (thisId === id) {
|
||||
index = i;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
const index = array.findIndex(item => {
|
||||
return item._id === id;
|
||||
});
|
||||
if (index === -1) {
|
||||
return null;
|
||||
}
|
||||
return index;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user