From e6df23162ed7cea021fffb41f186ab2a382294a0 Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Wed, 12 Aug 2015 16:46:04 -0700 Subject: [PATCH] Remove redundant TeeReader Signed-off-by: Alexander Morozov --- tar/storage/getter.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tar/storage/getter.go b/tar/storage/getter.go index ae110c6..70fd378 100644 --- a/tar/storage/getter.go +++ b/tar/storage/getter.go @@ -5,7 +5,6 @@ import ( "errors" "hash/crc64" "io" - "io/ioutil" "os" "path/filepath" ) @@ -97,8 +96,7 @@ type bitBucketFilePutter struct { func (bbfp *bitBucketFilePutter) Put(name string, r io.Reader) (int64, []byte, error) { c := crc64.New(CRCTable) - tRdr := io.TeeReader(r, c) - i, err := io.Copy(ioutil.Discard, tRdr) + i, err := io.Copy(c, r) return i, c.Sum(nil), err }