diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-07-13 01:47:01 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-13 01:47:01 -0700 |
commit | b54325f0da2baeb800ac10b0f4993bab0aa88882 (patch) | |
tree | 2cd5d4adf4c548452bcf6a4f4d0b6bc72b2c0c96 /plumbing/format/idxfile | |
parent | 3f4a03039e5f772c9e3073026b6703a43d491bcd (diff) | |
parent | ccf40c5a824cd755025ba58931e58722eddacbcc (diff) | |
download | go-git-b54325f0da2baeb800ac10b0f4993bab0aa88882.tar.gz |
Merge pull request #473 from taralx/patch-1
Use buffered IO for decoding index files.
Diffstat (limited to 'plumbing/format/idxfile')
-rw-r--r-- | plumbing/format/idxfile/decoder.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plumbing/format/idxfile/decoder.go b/plumbing/format/idxfile/decoder.go index 6618475..fea5f0b 100644 --- a/plumbing/format/idxfile/decoder.go +++ b/plumbing/format/idxfile/decoder.go @@ -1,6 +1,7 @@ package idxfile import ( + "bufio" "bytes" "errors" "io" @@ -19,12 +20,12 @@ var ( // Decoder reads and decodes idx files from an input stream. type Decoder struct { - io.Reader + *bufio.Reader } // NewDecoder builds a new idx stream decoder, that reads from r. func NewDecoder(r io.Reader) *Decoder { - return &Decoder{r} + return &Decoder{bufio.NewReader(r)} } // Decode reads from the stream and decode the content into the Idxfile struct. |