mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
fix: tweak read buffer size to reduce over-reading (#16338)
This commit is contained in:
@@ -81,6 +81,10 @@ func ReadFile(name string) ([]byte, error) {
|
||||
if err != nil {
|
||||
return io.ReadAll(r)
|
||||
}
|
||||
|
||||
// Select bigger blocks when reading at least 50% of a big block.
|
||||
r.SmallFile = st.Size() <= BlockSizeLarge/2
|
||||
|
||||
dst := make([]byte, st.Size())
|
||||
_, err = io.ReadFull(r, dst)
|
||||
return dst, err
|
||||
|
||||
Reference in New Issue
Block a user