mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-21 07:32:54 +00:00
Address reviewer feedback: avoid creating new RegExp objects on every viewport refresh. Now patterns are compiled once in setRules() and reused across refreshes. Changes: - Add CompiledRule interface with pre-compiled regex + color - Move regex compilation from refreshViewport() to setRules() - Reset regex.lastIndex before each line scan for correct reuse - Remove try/catch from hot path (errors caught at compile time) This reduces CPU/GC pressure especially with many rules or high-frequency terminal output. Co-Authored-By: Claude <noreply@anthropic.com>