Prefer startsWith over indexOf === 0

Faster and make code clearer
This commit is contained in:
Daniel Imms
2026-01-31 10:20:44 -08:00
parent 8eed7b4163
commit 39037ee806
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1780,7 +1780,7 @@ export class InputHandler extends Disposable implements IInputHandler {
* @param term The terminal name to evaluate
*/
private _is(term: string): boolean {
return (this._optionsService.rawOptions.termName + '').indexOf(term) === 0;
return (this._optionsService.rawOptions.termName + '').startsWith(term);
}
/**