···1111 "code.gitea.io/gitea/modules/highlight"
1212 "code.gitea.io/gitea/modules/indexer/code/internal"
1313 "code.gitea.io/gitea/modules/timeutil"
1414- "code.gitea.io/gitea/modules/util"
1514)
16151716// Result a search result to display
···7776 if index < result.EndIndex &&
7877 result.StartIndex < index+len(line) &&
7978 result.StartIndex < result.EndIndex {
8080- openActiveIndex := util.Max(result.StartIndex-index, 0)
8181- closeActiveIndex := util.Min(result.EndIndex-index, len(line))
7979+ openActiveIndex := max(result.StartIndex-index, 0)
8080+ closeActiveIndex := min(result.EndIndex-index, len(line))
8281 err = writeStrings(&formattedLinesBuffer,
8382 line[:openActiveIndex],
8483 line[openActiveIndex:closeActiveIndex],
-16
modules/util/util.go
···6060 return OptionalBoolOf(b)
6161}
62626363-// Max max of two ints
6464-func Max(a, b int) int {
6565- if a < b {
6666- return b
6767- }
6868- return a
6969-}
7070-7171-// Min min of two ints
7272-func Min(a, b int) int {
7373- if a > b {
7474- return b
7575- }
7676- return a
7777-}
7878-7963// IsEmptyString checks if the provided string is empty
8064func IsEmptyString(s string) bool {
8165 return len(strings.TrimSpace(s)) == 0