From 20ccd734ba1a38498d268226a3aa2e5f5f80d757 Mon Sep 17 00:00:00 2001 From: Filip Navara Date: Wed, 24 Apr 2019 09:22:30 +0200 Subject: Remove duplicate cache lookup in getObjectContent, it is already done in FSObject Signed-off-by: Filip Navara --- plumbing/format/packfile/packfile.go | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'plumbing/format/packfile/packfile.go') diff --git a/plumbing/format/packfile/packfile.go b/plumbing/format/packfile/packfile.go index 0dd9730..d4e6010 100644 --- a/plumbing/format/packfile/packfile.go +++ b/plumbing/format/packfile/packfile.go @@ -266,19 +266,6 @@ func (p *Packfile) getNextObject(h *ObjectHeader, hash plumbing.Hash) (plumbing. } func (p *Packfile) getObjectContent(offset int64) (io.ReadCloser, error) { - ref, err := p.FindHash(offset) - if err == nil { - obj, ok := p.cacheGet(ref) - if ok { - reader, err := obj.Reader() - if err != nil { - return nil, err - } - - return reader, nil - } - } - h, err := p.objectHeaderAtOffset(offset) if err != nil { return nil, err -- cgit