diff options
author | James Gregory <james@james.id.au> | 2013-08-07 15:12:50 -0700 |
---|---|---|
committer | James Gregory <james@james.id.au> | 2013-08-07 15:12:50 -0700 |
commit | 77a5d399c8614bd18f6a7a556f52ac0fc5c273c2 (patch) | |
tree | fd2ed663cf5e545201b392e4992ccd0fee9d1ccd | |
parent | 792959cea206b759a1402bb48d7797ebdee6c4ee (diff) |
Workaround for Chrome bug https://code.google.com/p/chromium/issues/detail?id=269679 : switch statement I added in isspace to make it faster seemed to cause the whole function to be optimized away. Replace with simple range checks in conditional expression.
-rw-r--r-- | src/library.js | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/src/library.js b/src/library.js index 9feeac6d..61237d07 100644 --- a/src/library.js +++ b/src/library.js @@ -4947,17 +4947,7 @@ LibraryManager.library = { (chr >= {{{ charCode('{') }}} && chr <= {{{ charCode('~') }}}); }, isspace: function(chr) { - switch(chr) { - case 32: - case 9: - case 10: - case 11: - case 12: - case 13: - return true; - default: - return false; - }; + return (chr == 32) || (chr >= 9 && chr <= 13); }, isblank: function(chr) { return chr == {{{ charCode(' ') }}} || chr == {{{ charCode('\t') }}}; |