Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions internal/repositories/ftsutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package repositories
import (
"fmt"
"regexp"
"slices"
"strings"
)

Expand All @@ -13,7 +14,7 @@ func tokenizeQuery(query string) []string {
terms := make([]string, 0, len(words))
for _, word := range words {
word = strings.TrimSpace(word)
if word != "" && !inArray(word, terms) {
if word != "" && !slices.Contains(word, terms) {
terms = append(terms, word)
}
}
Expand Down Expand Up @@ -59,12 +60,3 @@ func buildPartialQueryLikes(field string, cond string, first int, n int) string
func escapeDID(s string) string {
return didCharacters.ReplaceAllString(s, "")
}

func inArray(needle string, haystack []string) bool {
for _, word := range haystack {
if needle == word {
return true
}
}
return false
}