Skip to content

Commit

Permalink
libpriv/origin: Use if-statement rather than ternary operator
Browse files Browse the repository at this point in the history
More verbose, but easier to follow.
Prep for adding more conditionals in that area.
  • Loading branch information
jlebon authored and cgwalters committed Oct 14, 2021
1 parent 7c2eef6 commit 77636fc
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/libpriv/rpmostree-origin.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -776,10 +776,16 @@ rpmostree_origin_add_packages (RpmOstreeOrigin *origin,
}

if (changed)
update_keyfile_pkgs_from_cache (origin, "packages",
local ? "requested-local" : "requested",
local ? origin->cached_local_packages
: origin->cached_packages, local);
{
const char *key = "requested";
GHashTable *ht = origin->cached_packages;
if (local)
{
key = "requested-local";
ht = origin->cached_local_packages;
}
update_keyfile_pkgs_from_cache (origin, "packages", key, ht, local);
}

set_changed (out_changed, changed);
return TRUE;
Expand Down

0 comments on commit 77636fc

Please sign in to comment.