From ca83439467ac175b552bc225f4b9b47212848149 Mon Sep 17 00:00:00 2001 From: "vitess-bot[bot]" <108069721+vitess-bot[bot]@users.noreply.github.com> Date: Thu, 22 Feb 2024 07:52:52 +0100 Subject: [PATCH] Skip for-loop alloc in `go/vt/discovery/healthcheck.go` (#15326) Signed-off-by: Tim Vaillancourt --- go/vt/discovery/healthcheck.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go/vt/discovery/healthcheck.go b/go/vt/discovery/healthcheck.go index 5d6a5e32662..5572e9a41d9 100644 --- a/go/vt/discovery/healthcheck.go +++ b/go/vt/discovery/healthcheck.go @@ -774,6 +774,7 @@ func FilterTargetsByKeyspaces(keyspaces []string, targets []*query.Target) []*qu func (hc *HealthCheckImpl) waitForTablets(ctx context.Context, targets []*query.Target, requireServing bool) error { targets = FilterTargetsByKeyspaces(KeyspacesToWatch, targets) + var tabletHealths []*TabletHealth for { // We nil targets as we find them. allPresent := true @@ -782,7 +783,6 @@ func (hc *HealthCheckImpl) waitForTablets(ctx context.Context, targets []*query. continue } - var tabletHealths []*TabletHealth if requireServing { tabletHealths = hc.GetHealthyTabletStats(target) } else {