aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-09-21 17:16:14 -0500
committerAlon Zakai <alonzakai@gmail.com>2013-09-23 14:33:24 -0700
commitb1f12d5192a10800c4694d22ef0fcc62d4b7d2b4 (patch)
treebeea56f2385f4898fc74e85007361b0172a6cfaf
parentbf33ff57eb76bdda9c5072498aa1d641cabc2dfe (diff)
optimize string compares in getNativeTypeSize
-rw-r--r--src/runtime.js6
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;
}
}