forked from TrueCloudLab/frostfs-node
[#217] object/policer: Leave readability instead of performance comment
Right now we pass redundant copy to callback outside the for-loop through the helpful boolean variable instead of calling it deeply nested. Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
parent
f1a4b8d322
commit
5900975d58
1 changed files with 3 additions and 0 deletions
|
@ -70,6 +70,9 @@ func (p *Policer) processNodes(ctx context.Context, addr *object.Address, nodes
|
||||||
|
|
||||||
if network.IsLocalAddress(p.localAddrSrc, node) {
|
if network.IsLocalAddress(p.localAddrSrc, node) {
|
||||||
if shortage == 0 {
|
if shortage == 0 {
|
||||||
|
// we can call the redundant copy callback
|
||||||
|
// here to slightly improve the performance
|
||||||
|
// instead of readability.
|
||||||
redundantLocalCopy = true
|
redundantLocalCopy = true
|
||||||
break
|
break
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue