mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-07-17 09:49:13 +00:00
Merge pull request #5080 from chlunde/perf-2
perf: Intersection: Avoid callid AllIds inside inner loop
This commit is contained in:
@@ -170,9 +170,10 @@ func (ra *ResAccumulator) FixBackReferences() (err error) {
|
|||||||
|
|
||||||
// Intersection drops the resources which "other" does not have.
|
// Intersection drops the resources which "other" does not have.
|
||||||
func (ra *ResAccumulator) Intersection(other resmap.ResMap) error {
|
func (ra *ResAccumulator) Intersection(other resmap.ResMap) error {
|
||||||
|
otherIds := other.AllIds()
|
||||||
for _, curId := range ra.resMap.AllIds() {
|
for _, curId := range ra.resMap.AllIds() {
|
||||||
toDelete := true
|
toDelete := true
|
||||||
for _, otherId := range other.AllIds() {
|
for _, otherId := range otherIds {
|
||||||
if otherId == curId {
|
if otherId == curId {
|
||||||
toDelete = false
|
toDelete = false
|
||||||
break
|
break
|
||||||
|
|||||||
Reference in New Issue
Block a user