From 77a5d399c8614bd18f6a7a556f52ac0fc5c273c2 Mon Sep 17 00:00:00 2001 From: James Gregory Date: Wed, 7 Aug 2013 15:12:50 -0700 Subject: 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. --- src/library.js | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'src') 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') }}}; -- cgit v1.2.3-18-g5258