Combine mulitple appends into a single call
This is a minor performance optimisation that doesn't really matter in the context of calling the Add functions once at startup. It could matter in other cases, and thus I think it's worth changing so the linter can catch it in future. Signed-off-by: Nic Cope <negz@rk0n.org>
This commit is contained in:
parent
9a8614d509
commit
eddb9f45ee
|
@ -34,13 +34,15 @@ import (
|
|||
|
||||
func init() {
|
||||
// Register the types with the Scheme so the components can map objects to GroupVersionKinds and back
|
||||
AddToSchemes = append(AddToSchemes, aws.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, azure.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, cache.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, compute.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, core.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, gcp.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, storage.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes,
|
||||
aws.AddToScheme,
|
||||
azure.AddToScheme,
|
||||
cache.AddToScheme,
|
||||
compute.AddToScheme,
|
||||
core.AddToScheme,
|
||||
gcp.AddToScheme,
|
||||
storage.AddToScheme,
|
||||
)
|
||||
}
|
||||
|
||||
// AddToSchemes may be used to add all resources defined in the project to a Scheme
|
||||
|
|
|
@ -29,11 +29,13 @@ import (
|
|||
|
||||
func init() {
|
||||
// Register the types with the Scheme so the components can map objects to GroupVersionKinds and back
|
||||
AddToSchemes = append(AddToSchemes, cache.SchemeBuilder.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, compute.SchemeBuilder.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, database.SchemeBuilder.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, awsv1alpha1.SchemeBuilder.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, storage.SchemeBuilder.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes,
|
||||
cache.SchemeBuilder.AddToScheme,
|
||||
compute.SchemeBuilder.AddToScheme,
|
||||
database.SchemeBuilder.AddToScheme,
|
||||
awsv1alpha1.SchemeBuilder.AddToScheme,
|
||||
storage.SchemeBuilder.AddToScheme,
|
||||
)
|
||||
}
|
||||
|
||||
// AddToSchemes may be used to add all resources defined in the project to a Scheme
|
||||
|
|
|
@ -28,10 +28,12 @@ import (
|
|||
|
||||
func init() {
|
||||
// Register the types with the Scheme so the components can map objects to GroupVersionKinds and back
|
||||
AddToSchemes = append(AddToSchemes, azure.SchemeBuilder.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, cachev1alpha1.SchemeBuilder.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, databasev1alpha1.SchemeBuilder.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, computev1alpha1.SchemeBuilder.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes,
|
||||
azure.SchemeBuilder.AddToScheme,
|
||||
cachev1alpha1.SchemeBuilder.AddToScheme,
|
||||
databasev1alpha1.SchemeBuilder.AddToScheme,
|
||||
computev1alpha1.SchemeBuilder.AddToScheme,
|
||||
)
|
||||
}
|
||||
|
||||
// AddToSchemes may be used to add all resources defined in the project to a Scheme
|
||||
|
|
|
@ -107,7 +107,7 @@ func (c *ConditionedStatus) SetCondition(condition Condition) {
|
|||
return
|
||||
}
|
||||
newConditions := FilterOutCondition(c.Conditions, condition.Type)
|
||||
newConditions := append(newConditions, condition)
|
||||
newConditions = append(newConditions, condition)
|
||||
c.Conditions = newConditions
|
||||
}
|
||||
|
||||
|
|
|
@ -28,10 +28,12 @@ import (
|
|||
|
||||
func init() {
|
||||
// Register the types with the Scheme so the components can map objects to GroupVersionKinds and back
|
||||
AddToSchemes = append(AddToSchemes, v1alpha1.SchemeBuilder.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, cachev1alpha1.SchemeBuilder.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, computev1alpha1.SchemeBuilder.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes, databasev1alpha1.SchemeBuilder.AddToScheme)
|
||||
AddToSchemes = append(AddToSchemes,
|
||||
v1alpha1.SchemeBuilder.AddToScheme,
|
||||
cachev1alpha1.SchemeBuilder.AddToScheme,
|
||||
computev1alpha1.SchemeBuilder.AddToScheme,
|
||||
databasev1alpha1.SchemeBuilder.AddToScheme,
|
||||
)
|
||||
}
|
||||
|
||||
// AddToSchemes may be used to add all resources defined in the project to a Scheme
|
||||
|
|
Loading…
Reference in New Issue