From 5900975d589f848c5df19331bfe0d853a6ad8fd6 Mon Sep 17 00:00:00 2001 From: Leonard Lyubich Date: Wed, 24 Feb 2021 18:17:20 +0300 Subject: [PATCH] [#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 --- pkg/services/policer/check.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/services/policer/check.go b/pkg/services/policer/check.go index 6bef137c..4f03e0fd 100644 --- a/pkg/services/policer/check.go +++ b/pkg/services/policer/check.go @@ -70,6 +70,9 @@ func (p *Policer) processNodes(ctx context.Context, addr *object.Address, nodes if network.IsLocalAddress(p.localAddrSrc, node) { if shortage == 0 { + // we can call the redundant copy callback + // here to slightly improve the performance + // instead of readability. redundantLocalCopy = true break } else {