From 64498ce23d995922cb0afb83ba14c853ecbdfa8f Mon Sep 17 00:00:00 2001 From: Dirkjan Bussink Date: Thu, 22 Feb 2024 08:38:48 +0100 Subject: [PATCH] Revert "Skip for-loop alloc in `go/vt/discovery/healthcheck.go` (#15326)" This reverts commit e5499807932015dc7fb31569f5557005cc3119db. Signed-off-by: Dirkjan Bussink --- 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 5572e9a41d9..5d6a5e32662 100644 --- a/go/vt/discovery/healthcheck.go +++ b/go/vt/discovery/healthcheck.go @@ -774,7 +774,6 @@ 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 @@ -783,6 +782,7 @@ func (hc *HealthCheckImpl) waitForTablets(ctx context.Context, targets []*query. continue } + var tabletHealths []*TabletHealth if requireServing { tabletHealths = hc.GetHealthyTabletStats(target) } else {