[#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 <carpawell@nspcc.ru>remotes/KirillovDenis/feature/refactor-sig-rpc
parent
383edb1be4
commit
9dfc7e7fe9
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue