refactor: add Params.resetZdm() to collapse reset+addParam(0) into single call
Replaces 10 separate reset()+addParam(0) pairs across the parser with a single resetZdm() method that inlines both operations, avoiding two calls to a foreign object per sequence reset.
This commit is contained in:
@@ -129,6 +129,19 @@ export class Params implements IParams {
|
||||
this._digitIsSub = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset and add 0 as first param (ZDM).
|
||||
*/
|
||||
public resetZdm(): void {
|
||||
this.length = 1;
|
||||
this._subParamsLength = 0;
|
||||
this._rejectDigits = false;
|
||||
this._rejectSubDigits = false;
|
||||
this._digitIsSub = false;
|
||||
this._subParamsIdx[0] = 0;
|
||||
this.params[0] = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a parameter value.
|
||||
* `Params` only stores up to `maxLength` parameters, any later
|
||||
|
||||
Reference in New Issue
Block a user