mirror of
https://github.com/minio/minio.git
synced 2025-04-05 12:20:34 -04:00
loop only on readers once
This commit is contained in:
parent
d9bd5e2e10
commit
c366fdd2d8
@ -67,9 +67,6 @@ func erasureReader(readers []io.ReadCloser, donutMetadata map[string]string, wri
|
|||||||
summer := md5.New()
|
summer := md5.New()
|
||||||
params, _ := erasure.ParseEncoderParams(uint8(k), uint8(m), technique)
|
params, _ := erasure.ParseEncoderParams(uint8(k), uint8(m), technique)
|
||||||
encoder := erasure.NewEncoder(params)
|
encoder := erasure.NewEncoder(params)
|
||||||
for _, reader := range readers {
|
|
||||||
defer reader.Close()
|
|
||||||
}
|
|
||||||
for i := 0; i < totalChunks; i++ {
|
for i := 0; i < totalChunks; i++ {
|
||||||
curBlockSize := totalLeft
|
curBlockSize := totalLeft
|
||||||
if blockSize < totalLeft {
|
if blockSize < totalLeft {
|
||||||
@ -80,6 +77,7 @@ func erasureReader(readers []io.ReadCloser, donutMetadata map[string]string, wri
|
|||||||
|
|
||||||
encodedBytes := make([][]byte, 16)
|
encodedBytes := make([][]byte, 16)
|
||||||
for i, reader := range readers {
|
for i, reader := range readers {
|
||||||
|
defer reader.Close()
|
||||||
var bytesBuffer bytes.Buffer
|
var bytesBuffer bytes.Buffer
|
||||||
_, err := io.CopyN(&bytesBuffer, reader, int64(curChunkSize))
|
_, err := io.CopyN(&bytesBuffer, reader, int64(curChunkSize))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user