[#416] Make emptyOID a local variable

Signed-off-by: Denis Kirillov <denis@nspcc.ru>
This commit is contained in:
Denis Kirillov 2022-05-23 09:20:57 +03:00 committed by Alex Vanin
parent 25477cdaf8
commit cfa6098919

View file

@ -60,8 +60,6 @@ const (
maxGetSubTreeDepth = 10 // current limit on storage node side
)
var emptyOID oid.ID
// NewTreeClient creates instance of TreeClient using provided address and create grpc connection.
func NewTreeClient(addr string, key *keys.PrivateKey) (*TreeClient, error) {
conn, err := grpc.Dial(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
@ -309,6 +307,8 @@ func (c *TreeClient) getSubTreeLatestVersions(ctx context.Context, cnrID *cid.ID
return nil, err
}
var emptyOID oid.ID
latestVersions := make(map[string]*TreeNode, len(subTree))
for _, node := range subTree {
treeNode, err := newTreeNode(node)