1
0
mirror of https://github.com/koloml/philomena-tagging-assistant.git synced 2026-06-23 18:22:20 +00:00

Sonar: Replacing string.match(regexp) with regexp.exec(string)

This commit is contained in:
2026-06-14 03:19:54 +04:00
parent ed3db1240c
commit 3404877091

View File

@@ -189,7 +189,7 @@ export class QueryLexer {
*/
#matchAt(targetRegExp: RegExp, index: number, resultCarrier: MatchResultCarry = {}): resultCarrier is SuccessfulMatchResultCarry {
targetRegExp.lastIndex = index;
resultCarrier.match = this.#value.match(targetRegExp);
resultCarrier.match = targetRegExp.exec(this.#value);
return resultCarrier.match !== null;
}