mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
revert sort.Search
This commit is contained in:
parent
5b90a39954
commit
993283bb1d
|
@ -175,16 +175,21 @@ func findByPartNumber(fileName string, parts []CompletedPart) (etag string, foun
|
||||||
if formatErr != nil {
|
if formatErr != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
foundParts := []int{}
|
x := sort.Search(len(parts), func(i int) bool {
|
||||||
for i, part := range parts {
|
return parts[i].PartNumber >= partNumber
|
||||||
if part.PartNumber == partNumber {
|
})
|
||||||
foundParts = append(foundParts, i)
|
if parts[x].PartNumber != partNumber {
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(foundParts) == 0 {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
return parts[foundParts[len(foundParts)-1]].ETag, true
|
y := 0
|
||||||
|
for i, part := range parts[x:] {
|
||||||
|
if part.PartNumber == partNumber {
|
||||||
|
y = i
|
||||||
|
} else {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return parts[x+y].ETag, true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s3a *S3ApiServer) abortMultipartUpload(input *s3.AbortMultipartUploadInput) (output *s3.AbortMultipartUploadOutput, code s3err.ErrorCode) {
|
func (s3a *S3ApiServer) abortMultipartUpload(input *s3.AbortMultipartUploadInput) (output *s3.AbortMultipartUploadOutput, code s3err.ErrorCode) {
|
||||||
|
|
Loading…
Reference in a new issue