From 553fba6a738578058d4afc1897bd210d90bb0474 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Mon, 22 Apr 2019 12:30:05 +0200 Subject: Get the buffer from pool in fillOFSDeltaObjectContent instead of creating new one Signed-off-by: Filip Navara --- plumbing/format/packfile/packfile.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plumbing/format') 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 { -- cgit