-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
matchtree: do not depend on String for symbol all optimization (#746)
In go 1.22 the way go converts a query like .* into a String changed. This meant that when we compiled zoekt in the sourcegraph codebase our "regex matches all" optimization stopped working. This commit moves us to a simple inspection of the syntax tree which will be stable across versions and to be honest just feels better. To do this we introduce a field "origRegexp" to the regexpMatchTree so we can avoid needing to recompile the syntax tree. Note: Regexp does not offer a way to get at its internal syntax.Regexp which would be nice. Test Plan: go test and added a unit test
- Loading branch information
1 parent
52a28e3
commit cc5e093
Showing
2 changed files
with
92 additions
and
23 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