Skip to content

Commit

Permalink
Add log
Browse files Browse the repository at this point in the history
  • Loading branch information
yzang2019 committed Oct 7, 2023
1 parent 11ab8fe commit e600427
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions changeset/import.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package changeset

import (
"bufio"
"encoding/binary"
"fmt"
"github.com/DataDog/zstd"
Expand Down Expand Up @@ -51,8 +50,7 @@ func openChangesetFile(fileName string) (Reader, error) {
return nil, err
}
zstdReaderCloser := zstd.NewReader(fp)
bufReader := bufio.NewReader(zstdReaderCloser)
return &WrapReader{zstdReaderCloser, bufReader, fp}, nil
return &WrapReader{zstdReaderCloser, fp}, nil
}

func iterateChangeSet(reader Reader, fn func(version int64, changeset *iavl.ChangeSet) (bool, error)) (int64, error) {
Expand Down
5 changes: 3 additions & 2 deletions changeset/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

type WrapReader struct {
readerCloser io.ReadCloser
byteReader io.ByteReader
closer io.Closer
}

Expand All @@ -15,7 +14,9 @@ func (r *WrapReader) Read(p []byte) (int, error) {
}

func (r *WrapReader) ReadByte() (byte, error) {
return r.byteReader.ReadByte()
var singleByte [1]byte
_, err := r.readerCloser.Read(singleByte[:])
return singleByte[0], err
}

func (r *WrapReader) Close() error {
Expand Down

0 comments on commit e600427

Please sign in to comment.