Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Use buffered IO for decoding index files. #473

Merged
merged 1 commit into from
Jul 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions plumbing/format/idxfile/decoder.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package idxfile

import (
"bufio"
"bytes"
"errors"
"io"
Expand All @@ -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.
Expand Down