diff options
author | alon@honor <none@none> | 2010-10-21 14:59:51 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-10-21 14:59:51 -0700 |
commit | 29fc5282681891989ce18a915da5975310e78abe (patch) | |
tree | cf113fcdbc3272eea15363f4525a0a8fa4f814bb | |
parent | 653032fba001d549f3a9a7b4387eb1fa42600428 (diff) |
optimize flattener appearances
-rw-r--r-- | src/jsifier.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/jsifier.js b/src/jsifier.js index d4e9f403..15c5bbba 100644 --- a/src/jsifier.js +++ b/src/jsifier.js @@ -768,8 +768,8 @@ function JSify(data) { if (typeData.flatFactor) { indexes.push(getFastValue(curr, '*', typeData.flatFactor)); } else { - if (curr == 0) { - indexes.push(0); // The first index is always 0 anyhow TODO: Assert this in the other places + if (isNumber(curr)) { + indexes.push(typeData.flatIndexes[curr]); } else { indexes.push(toNiceIdent(type) + '___FLATTENER[' + curr + ']'); // TODO: If curr is constant, optimize out the flattener struct } |