Skip to content

Commit

Permalink
Compare fmt.Sprint output directly
Browse files Browse the repository at this point in the history
Using `reflect.deepEqual()` is unnecessary

Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
  • Loading branch information
dhaiducek authored and openshift-ci[bot] committed Oct 17, 2023
1 parent c04c0b2 commit 8931b33
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions controllers/configurationpolicy_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,8 @@ func equalObjWithSort(mergedObj interface{}, oldObj interface{}) (areEqual bool)
return fmt.Sprint(zero) == fmt.Sprint(oldObj)
}

if !reflect.DeepEqual(fmt.Sprint(mergedObj), fmt.Sprint(oldObj)) {
return false
}
return fmt.Sprint(mergedObj) == fmt.Sprint(oldObj)
}

return true
}

// checkFieldsWithSort is a check for maps that uses an arbitrary sort to ensure it is
Expand Down

0 comments on commit 8931b33

Please sign in to comment.