1
0
Fork 0
forked from forgejo/forgejo

Use Go 1.21 and update dependencies (#26878)

To make sure Gitea's next release's lifecycle could have active Golang
support.

And min/max are builtin now.
This commit is contained in:
wxiaoguang 2023-09-03 18:34:57 +08:00 committed by GitHub
parent 7477c93d62
commit fc039167d2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 81 additions and 79 deletions

View file

@ -7,8 +7,6 @@ import (
"encoding/csv"
"errors"
"io"
"code.gitea.io/gitea/modules/util"
)
const (
@ -396,7 +394,7 @@ func tryMapColumnsByContent(baseCSVReader *csvReader, base2HeadColMap []int, hea
headStart := 0
for base2HeadColMap[i] == unmappedColumn && headStart < len(head2BaseColMap) {
if head2BaseColMap[headStart] == unmappedColumn {
rows := util.Min(maxRowsToInspect, util.Max(0, util.Min(len(baseCSVReader.buffer), len(headCSVReader.buffer))-1))
rows := min(maxRowsToInspect, max(0, min(len(baseCSVReader.buffer), len(headCSVReader.buffer))-1))
same := 0
for j := 1; j <= rows; j++ {
baseCell, baseErr := getCell(baseCSVReader.buffer[j], i)