From 05516514b527250fca2bb7cf0e9d1b8db590638c Mon Sep 17 00:00:00 2001 From: Shane Date: Tue, 19 Nov 2024 12:59:00 +0800 Subject: [PATCH] simplify some logic Signed-off-by: Shane --- apis/keda/v1alpha1/scaledobject_types.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/apis/keda/v1alpha1/scaledobject_types.go b/apis/keda/v1alpha1/scaledobject_types.go index 90ae3b9632c..e09e9859a46 100644 --- a/apis/keda/v1alpha1/scaledobject_types.go +++ b/apis/keda/v1alpha1/scaledobject_types.go @@ -277,11 +277,7 @@ func (so *ScaledObject) CheckReplicasNotNegative(replicas ...int32) bool { // GetIdleReplicasIfDefined returns bool based on whether idleRelicas is defined func (so *ScaledObject) GetIdleReplicasIfDefined() bool { - if so.Spec.IdleReplicaCount != nil { - return true - } - return false -} + return so.Spec.IdleReplicaCount != nil // checkReplicaCountBoundsAreValid checks that Idle/Min/Max ReplicaCount defined in ScaledObject are correctly specified // i.e. that Min is not greater than Max or Idle greater or equal to Min