Skip to content

Commit

Permalink
RHINENG-9682: compare values not pointers, update object in the map n…
Browse files Browse the repository at this point in the history
…ot a copy
  • Loading branch information
MichaelMraka committed Apr 24, 2024
1 parent 0333122 commit a1c0e02
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions evaluator/evaluate_packages.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ func loadSystemNEVRAsFromDB(tx *gorm.DB, system *models.SystemPlatform, packages
} else {
p.Change = Keep
}
packages[nevra] = p
} else {
packages[nevra] = namedPackage{
NameID: columns.NameID,
Expand Down Expand Up @@ -248,10 +249,10 @@ func isValidNevra(nevra string) bool {
func latestPkgsChanged(current, stored namedPackage) bool {
installableEqual := (current.InstallableID == nil && stored.InstallableID == nil) ||
(current.InstallableID != nil && stored.InstallableID != nil &&
current.InstallableID == stored.InstallableID)
*current.InstallableID == *stored.InstallableID)
applicableEqual := (current.ApplicableID == nil && stored.ApplicableID == nil) ||
(current.ApplicableID != nil && stored.ApplicableID != nil &&
current.ApplicableID == stored.ApplicableID)
*current.ApplicableID == *stored.ApplicableID)
return !(installableEqual && applicableEqual)
}

Expand Down

0 comments on commit a1c0e02

Please sign in to comment.