diff options
author | Filip Navara <filip.navara@gmail.com> | 2019-04-22 12:30:05 +0200 |
---|---|---|
committer | Filip Navara <filip.navara@gmail.com> | 2019-04-22 12:30:05 +0200 |
commit | 553fba6a738578058d4afc1897bd210d90bb0474 (patch) | |
tree | 1ecb3490a27aedb17c3e91ea3f234ac2ff5e7053 /plumbing/format/packfile/packfile.go | |
parent | 72b97da989cd917ed835bd3dc6a0927c8da83480 (diff) | |
download | go-git-553fba6a738578058d4afc1897bd210d90bb0474.tar.gz |
Get the buffer from pool in fillOFSDeltaObjectContent instead of creating new one
Signed-off-by: Filip Navara <filip.navara@gmail.com>
Diffstat (limited to 'plumbing/format/packfile/packfile.go')
-rw-r--r-- | plumbing/format/packfile/packfile.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/plumbing/format/packfile/packfile.go b/plumbing/format/packfile/packfile.go index 0aad3e7..3d32b36 100644 --- a/plumbing/format/packfile/packfile.go +++ b/plumbing/format/packfile/packfile.go @@ -349,7 +349,7 @@ func (p *Packfile) fillREFDeltaObjectContentWithBuffer(obj plumbing.EncodedObjec } func (p *Packfile) fillOFSDeltaObjectContent(obj plumbing.EncodedObject, offset int64) error { - buf := bytes.NewBuffer(nil) + buf := bufPool.Get().(*bytes.Buffer) buf.Reset() _, _, err := p.s.NextObject(buf) if err != nil { |