From 9dfc7e7fe9d9d11ed25648665d34f48815401d18 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 11 Jun 2021 15:45:04 +0300 Subject: [PATCH] [#307] v2/storagegroup/test: Do not allocate memory if `!empty` Move all memory allocation and field settings in `Generate...(empty bool)` functions behind `if !empty` check. Signed-off-by: Pavel Karpy --- v2/storagegroup/test/generate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2/storagegroup/test/generate.go b/v2/storagegroup/test/generate.go index c8c67ba1..048ec24c 100644 --- a/v2/storagegroup/test/generate.go +++ b/v2/storagegroup/test/generate.go @@ -11,10 +11,10 @@ func GenerateStorageGroup(empty bool) *storagegroup.StorageGroup { if !empty { m.SetValidationDataSize(44) m.SetExpirationEpoch(55) + m.SetMembers(refstest.GenerateObjectIDs(false)) } m.SetValidationHash(refstest.GenerateChecksum(empty)) - m.SetMembers(refstest.GenerateObjectIDs(empty)) return m }