Skip to content

Commit 4eac6d1

Browse files
committed
Merge branch 'main' into Thegaram-patch-1
2 parents 01efe0d + cddc263 commit 4eac6d1

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

encoding/codecv7_types.go

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package encoding
22

33
import (
4-
"bytes"
54
"encoding/binary"
65
"encoding/hex"
76
"encoding/json"
@@ -474,17 +473,14 @@ func (c *daChunkV7) Hash() (common.Hash, error) {
474473

475474
// decompressV7Bytes decompresses the given blob bytes into the original payload bytes.
476475
func decompressV7Bytes(compressedBytes []byte) ([]byte, error) {
477-
var res []byte
478-
479476
compressedBytes = append(zstdMagicNumber, compressedBytes...)
480-
r := bytes.NewReader(compressedBytes)
481-
zr, err := zstd.NewReader(r, zstd.WithDecoderConcurrency(1))
477+
zr, err := zstd.NewReader(nil, zstd.WithDecoderConcurrency(1))
482478
if err != nil {
483479
return nil, fmt.Errorf("failed to create zstd reader: %w", err)
484480
}
485481
defer zr.Close()
486482

487-
res, err = zr.DecodeAll(compressedBytes, res)
483+
res, err := zr.DecodeAll(compressedBytes, nil)
488484
if err != nil {
489485
return nil, fmt.Errorf("failed to decompress zstd data: %w", err)
490486
}

0 commit comments

Comments
 (0)