Skip to content

Commit

Permalink
hoist conversion to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
boyter committed May 30, 2023
1 parent 52fd9be commit 06fa701
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,10 +226,11 @@ func IndexAllIgnoreCase(haystack string, needle string, limit int) [][]int {
// However after some investigation it turns out that this turns
// into a fancy vector instruction on AMD64 (which is all we care about)
// and as such its pretty hard to beat.
haystackRune := []rune(haystack)

for _, term := range searchTerms {
potentialMatches := IndexAll(haystack, term, -1)

haystackRune := []rune(haystack)
for _, match := range potentialMatches {
// We have a potential match, so now see if it actually matches
// by getting the actual value out of our haystack
Expand Down

0 comments on commit 06fa701

Please sign in to comment.