From 86d446f54c057f5c45e0f51690fa1b26f69b1a67 Mon Sep 17 00:00:00 2001 From: Pavel Karpy Date: Fri, 11 Jun 2021 15:45:27 +0300 Subject: [PATCH] [#307] v2/tombstone/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/tombstone/test/generate.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/v2/tombstone/test/generate.go b/v2/tombstone/test/generate.go index 678323a8..771f1092 100644 --- a/v2/tombstone/test/generate.go +++ b/v2/tombstone/test/generate.go @@ -11,9 +11,8 @@ func GenerateTombstone(empty bool) *tombstone.Tombstone { if !empty { m.SetExpirationEpoch(89) m.SetSplitID([]byte{3, 2, 1}) + m.SetMembers(refstest.GenerateObjectIDs(false)) } - m.SetMembers(refstest.GenerateObjectIDs(empty)) - return m }