@@ -72,23 +72,23 @@ func (m *Matrix) FanOut() []Params {
72
72
for _ , parameter := range m .Params {
73
73
combinations = combinations .fanOutMatrixParams (parameter )
74
74
}
75
- combinations = combinations .overwriteCombinations (includeCombinations )
75
+ combinations .overwriteCombinations (includeCombinations )
76
76
combinations = combinations .addNewCombinations (includeCombinations )
77
77
return combinations .toParams ()
78
78
}
79
79
80
- // overwriteCombinations replaces any missing include params in the initial
81
- // matrix params combinations by overwriting the initial combinations with the
82
- // include combinations
83
- func (cs Combinations ) overwriteCombinations (ics Combinations ) Combinations {
80
+ func (cs Combinations ) overwriteCombinations (ics Combinations ) {
84
81
for _ , paramCombination := range cs {
85
82
for _ , includeCombination := range ics {
86
83
if paramCombination .contains (includeCombination ) {
87
- includeCombination .overwrite (paramCombination )
84
+ // overwrite the parameter name and value in existing combination
85
+ // with the include combination
86
+ for name , val := range includeCombination {
87
+ paramCombination [name ] = val
88
+ }
88
89
}
89
90
}
90
91
}
91
- return cs
92
92
}
93
93
94
94
// addNewCombinations creates a new combination for any include parameter
@@ -115,14 +115,6 @@ func (c Combination) contains(includeCombination Combination) bool {
115
115
return true
116
116
}
117
117
118
- // overwrite the parameter name and value exists in combination with the include combination
119
- func (c Combination ) overwrite (oldCombination Combination ) Combination {
120
- for name , val := range c {
121
- oldCombination [name ] = val
122
- }
123
- return oldCombination
124
- }
125
-
126
118
// shouldAddNewCombination returns true if the include parameter name exists but the value is
127
119
// missing from combinations
128
120
func (cs Combinations ) shouldAddNewCombination (includeCombination map [string ]string ) bool {
0 commit comments