mirror of
https://github.com/pgsty/minio.git
synced 2026-03-16 17:53:43 +01:00
simplify sort.Sort by using sort.Slice (#17066)
This commit is contained in:
@@ -890,7 +890,9 @@ func (api objectAPIHandlers) CompleteMultipartUploadHandler(w http.ResponseWrite
|
||||
writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrMalformedXML), r.URL)
|
||||
return
|
||||
}
|
||||
if !sort.IsSorted(CompletedParts(complMultipartUpload.Parts)) {
|
||||
if !sort.SliceIsSorted(complMultipartUpload.Parts, func(i, j int) bool {
|
||||
return complMultipartUpload.Parts[i].PartNumber < complMultipartUpload.Parts[j].PartNumber
|
||||
}) {
|
||||
writeErrorResponse(ctx, w, errorCodes.ToAPIErr(ErrInvalidPartOrder), r.URL)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user