diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2019-04-22 16:44:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-22 16:44:33 +0200 |
commit | 6d4408addbaec52b861012688df0f09b79362e42 (patch) | |
tree | 239d82105d8f8cffe0ccd727311482ffeab0371c /plumbing/object/commit.go | |
parent | 78092a2843dc534d6f5ee2048f608d84c407bf46 (diff) | |
parent | 936f65dc143f091d5bdb3ee43cf11b06f6635cab (diff) | |
download | go-git-6d4408addbaec52b861012688df0f09b79362e42.tar.gz |
Merge pull request #1125 from saracen/tree-walk-optimization
plumbing: TreeWalker performance improvement, bufio pool for objects
Diffstat (limited to 'plumbing/object/commit.go')
-rw-r--r-- | plumbing/object/commit.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/plumbing/object/commit.go b/plumbing/object/commit.go index b569d3c..511242d 100644 --- a/plumbing/object/commit.go +++ b/plumbing/object/commit.go @@ -171,7 +171,9 @@ func (c *Commit) Decode(o plumbing.EncodedObject) (err error) { } defer ioutil.CheckClose(reader, &err) - r := bufio.NewReader(reader) + r := bufPool.Get().(*bufio.Reader) + defer bufPool.Put(r) + r.Reset(reader) var message bool var pgpsig bool |