Prefer startsWith over indexOf === 0
Faster and make code clearer
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user