Skip to content

Commit 7d369b9

Browse files
committed
Refactor PathFilter checks in aggregation properties to remove nil checks in readStateToPortBody and refreshAggregationPropertiesState functions
1 parent 3dcf1a2 commit 7d369b9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

port/aggregation-properties/readStateToPortBody.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func aggregationPropertiesToBody(state *AggregationPropertiesModel) (*map[string
6262
newAggregationProperty.Query = *query
6363
}
6464

65-
if aggregationProperty.PathFilter != nil && len(aggregationProperty.PathFilter) > 0 {
65+
if len(aggregationProperty.PathFilter) > 0 {
6666
pathFilter := make([]cli.AggregationPropertyPathFilter, len(aggregationProperty.PathFilter))
6767
for i, pf := range aggregationProperty.PathFilter {
6868
pathFilter[i] = cli.AggregationPropertyPathFilter{}

port/aggregation-properties/refreshAggregationPropertyToState.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (r *AggregationPropertiesResource) refreshAggregationPropertiesState(state
3030
}
3131
state.Properties[aggregationPropertyIdentifier].Query = query
3232

33-
if aggregationProperty.PathFilter != nil && len(aggregationProperty.PathFilter) > 0 {
33+
if len(aggregationProperty.PathFilter) > 0 {
3434
pathFilter := make([]AggregationPropertyPathFilterModel, len(aggregationProperty.PathFilter))
3535
for i, pf := range aggregationProperty.PathFilter {
3636
pathFilter[i] = AggregationPropertyPathFilterModel{}

0 commit comments

Comments
 (0)