From 2f843de3eddeed9033c2ea29cb539db5b64b6224 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 23 Aug 2022 20:12:12 +0300 Subject: [PATCH] [#323] client: Remove `initCallContextWithoutKey` Signed-off-by: Evgenii Stratonikov --- client/common.go | 5 ----- client/object_delete.go | 4 +--- client/object_get.go | 4 +--- client/session.go | 4 +--- 4 files changed, 3 insertions(+), 14 deletions(-) diff --git a/client/common.go b/client/common.go index fbcaac35..eff95724 100644 --- a/client/common.go +++ b/client/common.go @@ -288,11 +288,6 @@ func (x *contextCall) processCall() bool { // initializes static cross-call parameters inherited from client. func (c *Client) initCallContext(ctx *contextCall) { ctx.key = c.prm.key - c.initCallContextWithoutKey(ctx) -} - -// initializes static cross-call parameters inherited from client except private key. -func (c *Client) initCallContextWithoutKey(ctx *contextCall) { ctx.resolveAPIFailures = c.prm.resolveNeoFSErrors ctx.callbackResp = c.prm.cbRespInfo ctx.netMagic = c.prm.netMagic diff --git a/client/object_delete.go b/client/object_delete.go index c669d0c1..543c1b41 100644 --- a/client/object_delete.go +++ b/client/object_delete.go @@ -148,11 +148,9 @@ func (c *Client) ObjectDelete(ctx context.Context, prm PrmObjectDelete) (*ResObj res ResObjectDelete ) + c.initCallContext(&cc) if prm.keySet { - c.initCallContextWithoutKey(&cc) cc.key = prm.key - } else { - c.initCallContext(&cc) } cc.req = &req diff --git a/client/object_get.go b/client/object_get.go index 0bf0729d..c1a1ccb5 100644 --- a/client/object_get.go +++ b/client/object_get.go @@ -499,11 +499,9 @@ func (c *Client) ObjectHead(ctx context.Context, prm PrmObjectHead) (*ResObjectH res.idObj = prm.objID + c.initCallContext(&cc) if prm.keySet { - c.initCallContextWithoutKey(&cc) cc.key = prm.key - } else { - c.initCallContext(&cc) } cc.req = &req diff --git a/client/session.go b/client/session.go index f90c10b4..66875a21 100644 --- a/client/session.go +++ b/client/session.go @@ -110,11 +110,9 @@ func (c *Client) SessionCreate(ctx context.Context, prm PrmSessionCreate) (*ResS res ResSessionCreate ) + c.initCallContext(&cc) if prm.keySet { - c.initCallContextWithoutKey(&cc) cc.key = prm.key - } else { - c.initCallContext(&cc) } cc.meta = prm.prmCommonMeta