From abadfd61be53f44a1a92e39e8f4918c3f803f329 Mon Sep 17 00:00:00 2001 From: RTann Date: Fri, 30 Aug 2024 08:37:58 -0700 Subject: [PATCH] chore: swap mathutil with builtin --- pkg/ioutils/lazy_reader_disk.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkg/ioutils/lazy_reader_disk.go b/pkg/ioutils/lazy_reader_disk.go index 1c19c0354..3a9b5b0ee 100644 --- a/pkg/ioutils/lazy_reader_disk.go +++ b/pkg/ioutils/lazy_reader_disk.go @@ -8,7 +8,6 @@ import ( "sync" "github.com/pkg/errors" - "github.com/stackrox/rox/pkg/mathutil" "github.com/stackrox/rox/pkg/utils" ) @@ -115,7 +114,7 @@ func (r *diskBackedLazyReaderAt) readAt(p []byte, off int64) (n int, err error) defer r.mutex.RUnlock() if off < r.maxBufferSize { - n, err = r.lzReader.ReadAt(p[:mathutil.MinInt64(int64(len(p)), r.maxBufferSize-off)], off) + n, err = r.lzReader.ReadAt(p[:min(int64(len(p)), r.maxBufferSize-off)], off) if err != nil || n == len(p) { return n, err } @@ -190,7 +189,7 @@ func (r *diskBackedLazyReaderAt) ensureOverflowToDisk(till int64) { // Copy up to the next block, aligned with size overflowBlockSize. // This is maxed to the size of the reader. - to := mathutil.MinInt64(((till-1)/overflowBlockSize+1)*overflowBlockSize, r.size) + to := min(((till-1)/overflowBlockSize+1)*overflowBlockSize, r.size) // If the entire reader size is required, then copy an extra byte to ensure EOF is recorded. if to == r.size { to++