diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-08-11 14:59:02 -0400 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-09-02 20:25:30 -0400 |
commit | fc4a9614123732688cad643117abf2a047593b43 (patch) | |
tree | 7d0c8aac295ad833918822412d7d359eb2be7714 /ext/fg/js | |
parent | 4ac55da7dd5354e6c3495f04583352d0d863b7b6 (diff) |
Replace some instances of Array.concat
.push or .unshift can accomplish the same operation without constructing new arrays.
Diffstat (limited to 'ext/fg/js')
-rw-r--r-- | ext/fg/js/document.js | 4 |
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]); } } |