diff --git a/api/internal/accumulator/resaccumulator.go b/api/internal/accumulator/resaccumulator.go index 2c1fc71b5..0f4008c97 100644 --- a/api/internal/accumulator/resaccumulator.go +++ b/api/internal/accumulator/resaccumulator.go @@ -170,9 +170,10 @@ func (ra *ResAccumulator) FixBackReferences() (err error) { // Intersection drops the resources which "other" does not have. func (ra *ResAccumulator) Intersection(other resmap.ResMap) error { + otherIds := other.AllIds() for _, curId := range ra.resMap.AllIds() { toDelete := true - for _, otherId := range other.AllIds() { + for _, otherId := range otherIds { if otherId == curId { toDelete = false break