perf(console): case-insensitive filtering without per-line copies
Console text filtering and match highlighting lowercased a full copy of every line, and of every drawn segment, on each pass. - A new alloc-free ASCII case-insensitive substring search folds both sides on the fly, so neither the filter test nor the highlight scan allocates a lowercased copy per line any more. - Both call sites use it; the case-insensitive match behaviour is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,10 @@ struct ConsoleOutputFilter {
|
||||
bool appMessagesEnabled = true; // App channel
|
||||
};
|
||||
|
||||
// Alloc-free ASCII case-insensitive substring search (C-locale fold). Returns the byte
|
||||
// offset of the first match at or after `from`, or npos. Needle is folded on the fly.
|
||||
size_t FindCaseInsensitive(const char* hay, size_t hayLen, const std::string& needle, size_t from);
|
||||
|
||||
// Whether a line with the given channel + text passes the active filter.
|
||||
bool consoleLinePassesFilter(const std::string& lineText,
|
||||
ConsoleChannel channel,
|
||||
|
||||
Reference in New Issue
Block a user