-
Notifications
You must be signed in to change notification settings - Fork 91
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
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
d94b6fe
commit f0b55a2
Showing
2 changed files
with
71 additions
and
7 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