java-topology/defects/istio/patch/istio-0004-backend-policy-parents-dedup-linear-scan.patch
russell@unturf.com 25c2bafdee undf: assign 694-720; stamp patches; ruby-0003/elixir-0002/r-source-0002/victoria-metrics-0002
New UNDF assignments (693→720):
  elixir-0002 → UNDF-2026-000000698 (typespec used_type_pairs O(T²))
  r-source-0002 → UNDF-2026-000000711 (.walkClassGraph match dedup O(S²))
  ruby-0003 → UNDF-2026-000000712 (RubyGems dependent_gems O(N²×D))
  victoria-metrics-0002 → UNDF-2026-000000717 (MetricName tag-filter O(T×I))

Total: 720 UNDF assigned
2026-03-29 22:28:31 -04:00

18 lines
852 B
Diff

# UNDF: UNDF-2026-000000704
--- a/pilot/pkg/config/kube/gateway/backend_policies.go
+++ b/pilot/pkg/config/kube/gateway/backend_policies.go
@@ -175,13 +175,15 @@ func BackendPolicyCollection(
portLevelSettings := make(map[string]*networking.TrafficPolicy_PortTrafficPolicy)
- parents := make([]string, 0, len(pols))
+ // Use seenParents map for O(1) dedup instead of O(P) slices.Contains per iteration.
+ parents := make([]string, 0, len(pols))
+ seenParents := make(map[string]struct{}, len(pols))
for _, pol := range pols {
...
parentName := pol.Source.Kind.String() + "/" + pol.Source.Namespace + "." + pol.Source.Name
- if !slices.Contains(parents, parentName) {
+ if _, exists := seenParents[parentName]; !exists {
+ seenParents[parentName] = struct{}{}
parents = append(parents, parentName)
}
}