diff --git a/tools/cheat-builder/cht.js b/tools/cheat-builder/cht.js index 6dc8abc..5c8c047 100644 --- a/tools/cheat-builder/cht.js +++ b/tools/cheat-builder/cht.js @@ -50,7 +50,8 @@ const findIndex = (t, tr, tlen) => { const read = (cht, info, order) => { let state = WAIT_LOCK, token = [], line = 1; - let locks = [], currlock = null, retval = []; + let locks = [], currlock = null + const retval = []; const token_str = () => { const r = token.join(""); return (token = [], r); } const error = msg => { throw new SyntaxError(`${msg} at line: ${line} in lock ${currlock?.name}`) } @@ -343,9 +344,9 @@ const lade = (list, info, order) => { if (cache[tr] != undefined) return cache[tr]; else { const code = conv.encode(tr); - const off = findIndex(strtable, code, size.str); - if( off >= 0 ) cache[tr] = off; - return off < 0 ? ut_pushtr(code) : off; + const off = ut_pushtr(code); + cache[tr] = off; + return off; } } })() : tr => {