Skip to content

Commit

Permalink
Skip for-loop alloc in go/vt/discovery/healthcheck.go (vitessio#15326)
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Vaillancourt <tim@timvaillancourt.com>
  • Loading branch information
vitess-bot[bot] committed Feb 22, 2024
1 parent e8283bf commit ca83439
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion go/vt/discovery/healthcheck.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -782,7 +783,6 @@ func (hc *HealthCheckImpl) waitForTablets(ctx context.Context, targets []*query.
continue
}

var tabletHealths []*TabletHealth
if requireServing {
tabletHealths = hc.GetHealthyTabletStats(target)
} else {
Expand Down

0 comments on commit ca83439

Please sign in to comment.