diff options
author | alon@honor <none@none> | 2010-10-14 21:00:06 -0700 |
---|---|---|
committer | alon@honor <none@none> | 2010-10-14 21:00:06 -0700 |
commit | 64facbdbb9e406cbe7284a4c939263c684469083 (patch) | |
tree | 9ecbc0ba9c7b6d46996693c181d349d2c96cfe7c /src/preamble.js | |
parent | 971976f42a3fafc2e7829370e6a401aa5830237f (diff) |
remove unnecessary boolean ==> int conversions; fix uncovered bug; 20% speedup
Diffstat (limited to 'src/preamble.js')
-rw-r--r-- | src/preamble.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/preamble.js b/src/preamble.js index 1af1a6e9..c930bb77 100644 --- a/src/preamble.js +++ b/src/preamble.js @@ -77,7 +77,7 @@ function Pointer_make(slab, pos, allocator) { #if USE_TYPED_ARRAYS // TODO: Check - also in non-typedarray case - for functions, and if so add |.__index__| var curr = slab[pos + i]; - if (typeof curr === 'number') { + if (typeof curr === 'number' || typeof curr === 'boolean') { IHEAP[ret + i] = curr; // TODO: optimize. Can easily detect floats, but 1.0 might look like an int... FHEAP[ret + i] = curr; } else { @@ -177,7 +177,7 @@ function __formatString() { next = HEAP[textIndex+1]; #endif if (curr == '%'.charCodeAt(0) && ['d', 'u', 'f', '.'].indexOf(String.fromCharCode(next)) != -1) { - var argText = String(arguments[argIndex]); + var argText = String(+arguments[argIndex]); // +: boolean=>int // Handle very very simply formatting, namely only %.Xf if (next == '.'.charCodeAt(0)) { #if USE_TYPED_ARRAYS |