-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lib: added
StringPattern
and made Automaton
no longer borrow the …
…query The `Automaton` struct borrowed the source query, which also caused the Engine to carry the query's lifetime with it. The actual data being borrowed were the `JsonString` values for member transitions. In preparation for #117 we remove the borrowed `JsonString` and replace it with `StringPattern`. For UTF-8 the `StringPattern` will be a more complex struct that precomputes some stuff for efficient matching later. For now, it's a thin wrapper over a `JsonString`. During construction we may create many transitions over the same pattern. To reduce the size of the automaton we cache the patterns and put them into an `Rc`. This may get optimised later to instead use some kind of inline storage, but it's unlikely to actually matter. I ran the benchmarks and saw no measurable difference between the previous version and this one. Refs: #117 #613
- Loading branch information
Showing
27 changed files
with
402 additions
and
333 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.