aboutsummaryrefslogtreecommitdiff
path: root/src/intertyper.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-09-21 16:38:29 -0500
committerAlon Zakai <alonzakai@gmail.com>2013-09-23 14:33:24 -0700
commitf388628298f260efa1ca4a7d5f87973cc5f06eee (patch)
treebf64c3b47a0133eee8aafa6ef901a8002a39b350 /src/intertyper.js
parent0f5c7d319c801ff432ede713148484584d968368 (diff)
optimize end of intertyper
Diffstat (limited to 'src/intertyper.js')
-rw-r--r--src/intertyper.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/intertyper.js b/src/intertyper.js
index 13377411..41967eb9 100644
--- a/src/intertyper.js
+++ b/src/intertyper.js
@@ -988,10 +988,13 @@ function intertyper(lines, sidePass, baseLineNums) {
// Input
- return lineSplitter().map(tokenizer).filter(function(item) { return item }).map(triager).filter(function(result) {
+ var ret = lineSplitter().map(tokenizer).filter(function(item) { return item }).map(triager).filter(function(result) {
if (!result) return false;
if (result.tokens) result.tokens = null; // We do not need tokens, past the intertyper. Clean them up as soon as possible here.
return true;
- }).concat(unparsedBundles).concat(extraResults);
+ });
+ if (unparsedBundles.length > 0) ret = ret.concat(unparsedBundles);
+ if (extraResults.length > 0) ret = ret.concat(extraResults);
+ return ret;
}