diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-09-21 17:16:14 -0500 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-09-23 14:33:24 -0700 |
commit | b1f12d5192a10800c4694d22ef0fcc62d4b7d2b4 (patch) | |
tree | beea56f2385f4898fc74e85007361b0172a6cfaf | |
parent | bf33ff57eb76bdda9c5072498aa1d641cabc2dfe (diff) |
optimize string compares in getNativeTypeSize
-rw-r--r-- | src/runtime.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/runtime.js b/src/runtime.js index 613ed882..00031fed 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -159,11 +159,11 @@ var Runtime = { case 'float': return 4; case 'double': return 8; default: { - if (type[type.length-1] == '*') { + if (type[type.length-1] === '*') { return Runtime.QUANTUM_SIZE; // A pointer - } else if (type[0] == 'i') { + } else if (type[0] === 'i') { var bits = parseInt(type.substr(1)); - assert(bits % 8 == 0); + assert(bits % 8 === 0); return bits/8; } } |