forked from TrueCloudLab/frostfs-node
[#365] settlement/basic: Use big.Int constructor for unification
Check if `new(big.Int)` will be efficient later and replace all `big.NewInt()` in code or leave it as it is. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
6a9a2b5d04
commit
3775d61ccb
4 changed files with 8 additions and 8 deletions
|
@ -17,12 +17,12 @@ func (t *NodeSizeTable) Put(id []byte, avg uint64) {
|
|||
}
|
||||
|
||||
func (t *NodeSizeTable) Total() *big.Int {
|
||||
return new(big.Int).SetUint64(t.total)
|
||||
return big.NewInt(0).SetUint64(t.total)
|
||||
}
|
||||
|
||||
func (t *NodeSizeTable) Iterate(f func([]byte, *big.Int)) {
|
||||
for k, v := range t.prices {
|
||||
n := new(big.Int).SetUint64(v)
|
||||
n := big.NewInt(0).SetUint64(v)
|
||||
f([]byte(k), n)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue