From 626532d7dd2134ac1e5a677a7bd27d1a9ffe006f Mon Sep 17 00:00:00 2001 From: Evgenii Baidakov Date: Thu, 4 May 2023 11:11:45 +0400 Subject: [PATCH] client: Use ByAddress instead of two calls FromContainer + ByID Signed-off-by: Evgenii Baidakov --- pool/pool.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pool/pool.go b/pool/pool.go index a5007318..58637873 100644 --- a/pool/pool.go +++ b/pool/pool.go @@ -697,8 +697,7 @@ func (c *clientWrapper) objectDelete(ctx context.Context, prm PrmObjectDelete) e } var cliPrm sdkClient.PrmObjectDelete - cliPrm.FromContainer(prm.addr.Container()) - cliPrm.ByID(prm.addr.Object()) + cliPrm.ByAddress(prm.addr) if prm.stoken != nil { cliPrm.WithinSession(*prm.stoken) @@ -733,8 +732,7 @@ func (c *clientWrapper) objectGet(ctx context.Context, prm PrmObjectGet) (ResGet } var cliPrm sdkClient.PrmObjectGet - cliPrm.FromContainer(prm.addr.Container()) - cliPrm.ByID(prm.addr.Object()) + cliPrm.ByAddress(prm.addr) if prm.stoken != nil { cliPrm.WithinSession(*prm.stoken) @@ -786,8 +784,7 @@ func (c *clientWrapper) objectHead(ctx context.Context, prm PrmObjectHead) (obje } var cliPrm sdkClient.PrmObjectHead - cliPrm.FromContainer(prm.addr.Container()) - cliPrm.ByID(prm.addr.Object()) + cliPrm.ByAddress(prm.addr) if prm.raw { cliPrm.MarkRaw() } @@ -831,8 +828,7 @@ func (c *clientWrapper) objectRange(ctx context.Context, prm PrmObjectRange) (Re } var cliPrm sdkClient.PrmObjectRange - cliPrm.FromContainer(prm.addr.Container()) - cliPrm.ByID(prm.addr.Object()) + cliPrm.ByAddress(prm.addr) cliPrm.SetOffset(prm.off) cliPrm.SetLength(prm.ln)