Regex: Switch filterString to foreach
Foreach is more performat than for const. That was used for debugging. Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
parent
a0a69e357d
commit
97cca9467b
|
@ -139,10 +139,10 @@ function runRegexScript(regexScript, rawString, { characterOverride } = {}) {
|
||||||
*/
|
*/
|
||||||
function filterString(rawString, trimStrings, { characterOverride } = {}) {
|
function filterString(rawString, trimStrings, { characterOverride } = {}) {
|
||||||
let finalString = rawString;
|
let finalString = rawString;
|
||||||
for (const trimString of trimStrings) {
|
trimStrings.forEach((trimString) => {
|
||||||
const subTrimString = substituteParams(trimString, undefined, characterOverride);
|
const subTrimString = substituteParams(trimString, undefined, characterOverride);
|
||||||
finalString = finalString.replaceAll(subTrimString, '');
|
finalString = finalString.replaceAll(subTrimString, '');
|
||||||
}
|
});
|
||||||
|
|
||||||
return finalString;
|
return finalString;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue