Skip to content

Commit 5d3977e

Browse files
committed
perf: use replaceAll instead of replacing plus
1 parent 03d1c41 commit 5d3977e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/parse.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ function parse(input) {
4242
if (i - startingIndex > 1) {
4343
// Optimization: Replace '+' with space
4444
if (hasPlus) {
45-
key = key.replace(/\+/g, " ");
46-
value = value.replace(/\+/g, " ");
45+
key = key.replaceAll("+", " ");
46+
value = value.replaceAll("+", " ");
4747
}
4848

4949
// Optimization: Do not decode if it's not necessary.

0 commit comments

Comments
 (0)