From fc4a9614123732688cad643117abf2a047593b43 Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Sun, 11 Aug 2019 14:59:02 -0400 Subject: Replace some instances of Array.concat .push or .unshift can accomplish the same operation without constructing new arrays. --- ext/fg/js/document.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ext/fg/js/document.js') 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]); } } -- cgit v1.2.3