Compile a simple glob into a predicate: * matches any run of characters (including none), ?
exactly one code point, everything else is literal. Patterns come from agents and users and are
applied to whole ring buffers on the app's main thread, so matching must not be able to blow up:
this is the classic single-backtrack wildcard algorithm, O(pattern × text) worst case, unlike a
RegExp with many .* groups. Compile once, then call for each record.
Compile a simple glob into a predicate:
*matches any run of characters (including none),?exactly one code point, everything else is literal. Patterns come from agents and users and are applied to whole ring buffers on the app's main thread, so matching must not be able to blow up: this is the classic single-backtrack wildcard algorithm, O(pattern × text) worst case, unlike a RegExp with many.*groups. Compile once, then call for each record.