From 01424ba1466048df0daf77392919d22ba5d3e5c1 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Wed, 22 Jul 2020 18:01:40 -0400 Subject: [PATCH] don't over allocate slice --- agent/consul/state/catalog_events.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agent/consul/state/catalog_events.go b/agent/consul/state/catalog_events.go index b72b7288c5..8e3e730b1f 100644 --- a/agent/consul/state/catalog_events.go +++ b/agent/consul/state/catalog_events.go @@ -262,7 +262,7 @@ func changeTypeFromChange(change memdb.Change) changeType { // switching connection details to be the proxy instead of the actual instance // in case of a sidecar. func serviceHealthToConnectEvents(events ...stream.Event) []stream.Event { - serviceHealthConnectEvents := make([]stream.Event, 0, len(events)) + var serviceHealthConnectEvents []stream.Event for _, event := range events { if event.Topic != TopicServiceHealth { // Skip non-health or any events already emitted to Connect topic