From 5ebede3a4e1e9bddbaed9c276ed5b4cd5e3f10cc Mon Sep 17 00:00:00 2001 From: a92126 <182859762@qq.com> Date: Tue, 15 Oct 2024 09:39:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B9=8B=E5=89=8D=E7=9A=84NO=5FREUSE=E5=B9=B6?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=8E=BB=E6=8E=89=E9=87=8D=E7=94=A8=EF=BC=8C?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E5=8E=BB=E6=8E=89=E4=BA=86=EF=BC=8C=E5=BF=AB?= =?UTF-8?q?=E4=BA=8630%=E3=80=82=E3=80=82=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/cheat-builder/cht.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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 => {