From 81681816587eacd6369d3cb964dc4af5eae07f2e Mon Sep 17 00:00:00 2001 From: Evgeniy Kulikov Date: Thu, 10 Dec 2020 18:15:18 +0300 Subject: [PATCH] Remove bufio writer and double creation of OffsetWriter Signed-off-by: Evgeniy Kulikov --- api/layer/object.go | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/api/layer/object.go b/api/layer/object.go index 324d9a6b..7cf0cc4a 100644 --- a/api/layer/object.go +++ b/api/layer/object.go @@ -1,7 +1,6 @@ package layer import ( - "bufio" "context" "io" "net/url" @@ -68,11 +67,8 @@ func (n *layer) objectHead(ctx context.Context, address *object.Address) (*objec // objectGet and write it into provided io.Reader. func (n *layer) objectGet(ctx context.Context, p *getParams) (*object.Object, error) { // prepare length/offset writer - b := bufio.NewWriter(p.Writer) - w := newWriter(b, p.offset, p.length) - writer := newWriter(w, p.offset, p.length) - - return n.cli.Object().Get(ctx, p.address, sdk.WithGetWriter(writer)) + w := newWriter(p.Writer, p.offset, p.length) + return n.cli.Object().Get(ctx, p.address, sdk.WithGetWriter(w)) } // objectPut into NeoFS, took payload from io.Reader.