forked from TrueCloudLab/frostfs-s3-gw
Remove bufio writer and double creation of OffsetWriter
Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
This commit is contained in:
parent
776eed76fb
commit
8168181658
1 changed files with 2 additions and 6 deletions
|
@ -1,7 +1,6 @@
|
||||||
package layer
|
package layer
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bufio"
|
|
||||||
"context"
|
"context"
|
||||||
"io"
|
"io"
|
||||||
"net/url"
|
"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.
|
// objectGet and write it into provided io.Reader.
|
||||||
func (n *layer) objectGet(ctx context.Context, p *getParams) (*object.Object, error) {
|
func (n *layer) objectGet(ctx context.Context, p *getParams) (*object.Object, error) {
|
||||||
// prepare length/offset writer
|
// prepare length/offset writer
|
||||||
b := bufio.NewWriter(p.Writer)
|
w := newWriter(p.Writer, p.offset, p.length)
|
||||||
w := newWriter(b, p.offset, p.length)
|
return n.cli.Object().Get(ctx, p.address, sdk.WithGetWriter(w))
|
||||||
writer := newWriter(w, p.offset, p.length)
|
|
||||||
|
|
||||||
return n.cli.Object().Get(ctx, p.address, sdk.WithGetWriter(writer))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// objectPut into NeoFS, took payload from io.Reader.
|
// objectPut into NeoFS, took payload from io.Reader.
|
||||||
|
|
Loading…
Reference in a new issue