diff options
author | Aidan Hobson Sayers <aidanhs@cantab.net> | 2013-08-20 18:00:53 +0100 |
---|---|---|
committer | Aidan Hobson Sayers <aidanhs@cantab.net> | 2013-08-20 20:07:26 +0100 |
commit | 09c1168629557ab46818785004bcb95b696e254c (patch) | |
tree | cde7c9588e18e849794833ed24143f5f8551aaa3 | |
parent | 12a4321cf394f968c0553e770e18c0b621542a31 (diff) |
Clearer (and faster?), as per jij's suggestion
-rw-r--r-- | src/runtime.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/runtime.js b/src/runtime.js index 959cdfd5..868aacb6 100644 --- a/src/runtime.js +++ b/src/runtime.js @@ -395,15 +395,15 @@ var Runtime = { code = code & 0xFF; if (buffer.length == 0) { - if ((code & 0x80) == 0) { // 0xxxxxxx + if ((code & 0x80) == 0x00) { // 0xxxxxxx return String.fromCharCode(code); } buffer.push(code); - if (((code & 0xE0) ^ 0xC0) == 0) { // 110xxxxx + if ((code & 0xE0) == 0xC0) { // 110xxxxx needed = 1; - } else if (((code & 0xF0) ^ 0xE0) == 0) { // 1110xxxx + } else if ((code & 0xF0) == 0xE0) { // 1110xxxx needed = 2; - } else { // 11110xxx + } else { // 11110xxx needed = 3; } return ''; |