feat: speed up javascript munging

Perform a single pass so the work of doing `m` replacements in a string
of length `n` is O(m + n) instead of O(m * n)

For the yogalogy template this change improves the script munging step
from ~2.5ms to 0.5ms [release] (from ~17ms to 3ms [debug]).
This commit is contained in:
YetAnotherMinion 2022-01-13 01:07:19 +00:00 committed by nobody
commit cc4c1cf9d5
Signed by: GrocerPublishAgent
GPG key ID: D460CD54A9E3AB86
4 changed files with 186 additions and 185 deletions

View file

@ -42,7 +42,7 @@ errorToString error =
"Failure `" ++ message ++ "`"
NotFound sql ->
"NotFound `" ++ sql ++ "`"
"No rows returned by a query that expected to return at least one row. `" ++ sql ++ "`"
execute : Query a -> Result Error a
execute query =