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:
kingbri 2024-01-06 00:33:52 -05:00
parent a0a69e357d
commit 97cca9467b
1 changed files with 2 additions and 2 deletions

View File

@ -139,10 +139,10 @@ function runRegexScript(regexScript, rawString, { characterOverride } = {}) {
*/
function filterString(rawString, trimStrings, { characterOverride } = {}) {
let finalString = rawString;
for (const trimString of trimStrings) {
trimStrings.forEach((trimString) => {
const subTrimString = substituteParams(trimString, undefined, characterOverride);
finalString = finalString.replaceAll(subTrimString, '');
}
});
return finalString;
}