summaryrefslogtreecommitdiff
path: root/ext/fg
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-08-11 14:59:02 -0400
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2019-09-02 20:25:30 -0400
commitfc4a9614123732688cad643117abf2a047593b43 (patch)
tree7d0c8aac295ad833918822412d7d359eb2be7714 /ext/fg
parent4ac55da7dd5354e6c3495f04583352d0d863b7b6 (diff)
Replace some instances of Array.concat
.push or .unshift can accomplish the same operation without constructing new arrays.
Diffstat (limited to 'ext/fg')
-rw-r--r--ext/fg/js/document.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/fg/js/document.js b/ext/fg/js/document.js
index bd876e5d..60b1b9bd 100644
--- a/ext/fg/js/document.js
+++ b/ext/fg/js/document.js
@@ -152,7 +152,7 @@ function docSentenceExtract(source, extent) {
if (quoteStack.length > 0 && c === quoteStack[0]) {
quoteStack.pop();
} else if (c in quotesBwd) {
- quoteStack = [quotesBwd[c]].concat(quoteStack);
+ quoteStack.unshift(quotesBwd[c]);
}
}
@@ -181,7 +181,7 @@ function docSentenceExtract(source, extent) {
if (quoteStack.length > 0 && c === quoteStack[0]) {
quoteStack.pop();
} else if (c in quotesFwd) {
- quoteStack = [quotesFwd[c]].concat(quoteStack);
+ quoteStack.unshift(quotesFwd[c]);
}
}