forked from TrueCloudLab/frostfs-api-go
[#307] v2/audit/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>
This commit is contained in:
parent
e15dd105fe
commit
772c8be200
1 changed files with 4 additions and 5 deletions
|
@ -19,12 +19,11 @@ func GenerateDataAuditResult(empty bool) *audit.DataAuditResult {
|
||||||
m.SetFailNodes([][]byte{{3}, {4}})
|
m.SetFailNodes([][]byte{{3}, {4}})
|
||||||
m.SetRequests(666)
|
m.SetRequests(666)
|
||||||
m.SetRetries(777)
|
m.SetRetries(777)
|
||||||
|
m.SetVersion(refstest.GenerateVersion(false))
|
||||||
|
m.SetContainerID(refstest.GenerateContainerID(false))
|
||||||
|
m.SetPassSG(refstest.GenerateObjectIDs(false))
|
||||||
|
m.SetFailSG(refstest.GenerateObjectIDs(false))
|
||||||
}
|
}
|
||||||
|
|
||||||
m.SetVersion(refstest.GenerateVersion(empty))
|
|
||||||
m.SetContainerID(refstest.GenerateContainerID(empty))
|
|
||||||
m.SetPassSG(refstest.GenerateObjectIDs(empty))
|
|
||||||
m.SetFailSG(refstest.GenerateObjectIDs(empty))
|
|
||||||
|
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue