diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/indexer/code/search.go | 5 | ||||
-rw-r--r-- | modules/util/util.go | 16 |
2 files changed, 2 insertions, 19 deletions
diff --git a/modules/indexer/code/search.go b/modules/indexer/code/search.go index 1f9bddff7b..fdb468df1a 100644 --- a/modules/indexer/code/search.go +++ b/modules/indexer/code/search.go @@ -11,7 +11,6 @@ import ( "code.gitea.io/gitea/modules/highlight" "code.gitea.io/gitea/modules/indexer/code/internal" "code.gitea.io/gitea/modules/timeutil" - "code.gitea.io/gitea/modules/util" ) // Result a search result to display @@ -77,8 +76,8 @@ func searchResult(result *internal.SearchResult, startIndex, endIndex int) (*Res if index < result.EndIndex && result.StartIndex < index+len(line) && result.StartIndex < result.EndIndex { - openActiveIndex := util.Max(result.StartIndex-index, 0) - closeActiveIndex := util.Min(result.EndIndex-index, len(line)) + openActiveIndex := max(result.StartIndex-index, 0) + closeActiveIndex := min(result.EndIndex-index, len(line)) err = writeStrings(&formattedLinesBuffer, line[:openActiveIndex], line[openActiveIndex:closeActiveIndex], diff --git a/modules/util/util.go b/modules/util/util.go index cc25539967..c47931f6c9 100644 --- a/modules/util/util.go +++ b/modules/util/util.go @@ -60,22 +60,6 @@ func OptionalBoolParse(s string) OptionalBool { return OptionalBoolOf(b) } -// Max max of two ints -func Max(a, b int) int { - if a < b { - return b - } - return a -} - -// Min min of two ints -func Min(a, b int) int { - if a > b { - return b - } - return a -} - // IsEmptyString checks if the provided string is empty func IsEmptyString(s string) bool { return len(strings.TrimSpace(s)) == 0 |