diff --git a/examples/server/public_simplechat/datautils.mjs b/examples/server/public_simplechat/datautils.mjs index 64ffcf745..b42d58555 100644 --- a/examples/server/public_simplechat/datautils.mjs +++ b/examples/server/public_simplechat/datautils.mjs @@ -73,20 +73,25 @@ export function trim_repeat_garbage_at_end_loop(sIn, maxSubL, maxMatchLenThresho /** * A simple minded try trim garbage at end using histogram characteristics * @param {string} sIn - * @param {number} maxSubL + * @param {number} maxUniq * @param {number} maxMatchLenThreshold */ -export function trim_hist_garbage_at_end(sIn, maxSubL, maxMatchLenThreshold) { +export function trim_hist_garbage_at_end(sIn, maxUniq, maxMatchLenThreshold) { if (sIn.length < maxMatchLenThreshold) { return { trimmed: false, data: sIn }; } // Learn let hist = {}; - for(let i=0; i= maxUniq) { + break; + } hist[c] = 1; } }