forked from TrueCloudLab/frostfs-node
[#972] Use min/max builtins
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
45fd4e4ff1
commit
89784b2e0a
10 changed files with 11 additions and 53 deletions
|
@ -343,10 +343,7 @@ func PayloadRange(ctx context.Context, prm PayloadRangePrm) (*PayloadRangeRes, e
|
|||
return nil, new(apistatus.ObjectOutOfRange)
|
||||
}
|
||||
|
||||
ln := prm.ln
|
||||
if ln > maxInitialBufferSize {
|
||||
ln = maxInitialBufferSize
|
||||
}
|
||||
ln := min(prm.ln, maxInitialBufferSize)
|
||||
|
||||
w := bytes.NewBuffer(make([]byte, ln))
|
||||
_, err = io.CopyN(w, rdr, int64(prm.ln))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue