之前的NO_REUSE并没有去掉重用,现在去掉了,快了30%。。。

This commit is contained in:
a92126 2024-10-15 09:39:57 +08:00
parent 491141bf94
commit 5ebede3a4e

View File

@ -50,7 +50,8 @@ const findIndex = (t, tr, tlen) => {
const read = (cht, info, order) => { const read = (cht, info, order) => {
let state = WAIT_LOCK, token = [], line = 1; 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 token_str = () => { const r = token.join(""); return (token = [], r); }
const error = msg => { throw new SyntaxError(`${msg} at line: ${line} in lock ${currlock?.name}`) } 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]; if (cache[tr] != undefined) return cache[tr];
else { else {
const code = conv.encode(tr); const code = conv.encode(tr);
const off = findIndex(strtable, code, size.str); const off = ut_pushtr(code);
if( off >= 0 ) cache[tr] = off; cache[tr] = off;
return off < 0 ? ut_pushtr(code) : off; return off;
} }
} }
})() : tr => { })() : tr => {