From 1ca95d75d13366f1094a906e58bc72b1c83374d4 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Tue, 23 Jan 2018 17:18:14 +1100 Subject: src/lobject.js: Use raw char code ops in luaO_hexavalue --- src/lobject.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lobject.js b/src/lobject.js index bbac165..bd0f1b2 100644 --- a/src/lobject.js +++ b/src/lobject.js @@ -397,8 +397,8 @@ const luaO_chunkid = function(source, bufflen) { }; const luaO_hexavalue = function(c) { - if (lisdigit(c)) return c - char['0']; - else return (String.fromCharCode(c).toLowerCase().charCodeAt(0) - char['a']) + 10; + if (lisdigit(c)) return c - 48; + else return (c & 0xdf) - 55; }; const UTF8BUFFSZ = 8; -- cgit v1.2.3-70-g09d2