mirror of https://github.com/minio/minio.git
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()
|
||||
params, _ := erasure.ParseEncoderParams(uint8(k), uint8(m), technique)
|
||||
encoder := erasure.NewEncoder(params)
|
||||
for _, reader := range readers {
|
||||
defer reader.Close()
|
||||
}
|
||||
for i := 0; i < totalChunks; i++ {
|
||||
curBlockSize := totalLeft
|
||||
if blockSize < totalLeft {
|
||||
|
@ -80,6 +77,7 @@ func erasureReader(readers []io.ReadCloser, donutMetadata map[string]string, wri
|
|||
|
||||
encodedBytes := make([][]byte, 16)
|
||||
for i, reader := range readers {
|
||||
defer reader.Close()
|
||||
var bytesBuffer bytes.Buffer
|
||||
_, err := io.CopyN(&bytesBuffer, reader, int64(curChunkSize))
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue