perf: collapse CSI state guard into single range check
Replace three !== checks (OSC_STRING, DCS_PASSTHROUGH, APC_STRING) with one < OSC_STRING comparison. States below OSC_STRING are all safe for the CSI fast-path; states above need the normal table path for proper subparser abort propagation.
This commit is contained in:
@@ -659,9 +659,7 @@ export class EscapeSequenceParser extends Disposable implements IEscapeSequenceP
|
||||
|
||||
// CSI fast-path: collapse ESC [ into a single entry, parse params+final in a tight loop
|
||||
if (code === 0x1b
|
||||
&& this.currentState !== ParserState.OSC_STRING
|
||||
&& this.currentState !== ParserState.DCS_PASSTHROUGH
|
||||
&& this.currentState !== ParserState.APC_STRING
|
||||
&& this.currentState < ParserState.OSC_STRING
|
||||
&& i + 1 < length && data[i + 1] === 0x5b
|
||||
) {
|
||||
this._params.reset();
|
||||
|
||||
Reference in New Issue
Block a user