diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-27 21:33:56 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-09-27 21:33:56 -0700 |
commit | 1f2058f6ecb8212986fa6566b966454268bdb972 (patch) | |
tree | fe6d3d335a72ac79730607c40cebcd0e8952f5f3 | |
parent | 5ae5fd072b04c8c26fa284f074e28509e0d10438 (diff) |
clean up intertyper paths fork
-rw-r--r-- | src/intertyper.js | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/intertyper.js b/src/intertyper.js index 1acad4f2..ce33a2d1 100644 --- a/src/intertyper.js +++ b/src/intertyper.js @@ -1072,7 +1072,6 @@ function intertyper(lines, sidePass, baseLineNums) { } } if (ret) { - fastPaths++; if (COMPILER_ASSERTIONS) { //printErr(['\n', JSON.stringify(ret), '\n', JSON.stringify(triager(tokenizer(line)))]); var normal = triager(tokenizer(line)); @@ -1080,7 +1079,6 @@ function intertyper(lines, sidePass, baseLineNums) { delete normal.indent; assert(sortedJsonCompare(normal, ret), 'fast path: ' + dump(normal) + '\n vs \n' + dump(ret)); } - finalResults.push(ret); } return ret; } @@ -1088,13 +1086,18 @@ function intertyper(lines, sidePass, baseLineNums) { // Input lineSplitter().forEach(function(line) { - if (tryFastPaths(line)) return; + var item = tryFastPaths(line); + if (item) { + finalResults.push(item); + fastPaths++; + return; + } slowPaths++; //var time = Date.now(); var t = tokenizer(line); - var item = triager(t); + item = triager(t); //var type = item ? item.intertype + (item.op ? ':' + item.op : ''): 'none'; //interProf[type] = (interProf[type] || 0) + Date.now() - time; |