aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/commit.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2019-04-22 16:44:33 +0200
committerGitHub <noreply@github.com>2019-04-22 16:44:33 +0200
commit6d4408addbaec52b861012688df0f09b79362e42 (patch)
tree239d82105d8f8cffe0ccd727311482ffeab0371c /plumbing/object/commit.go
parent78092a2843dc534d6f5ee2048f608d84c407bf46 (diff)
parent936f65dc143f091d5bdb3ee43cf11b06f6635cab (diff)
downloadgo-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.go4
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