lib/package: Re-order arch comparison branches

Making this a separate commit to increase the odds we get this right.
Prep for next commit.

Closes: #1274
Approved by: cgwalters
This commit is contained in:
Jonathan Lebon 2018-02-26 21:40:54 +00:00 committed by Atomic Bot
parent 56c192f5cc
commit 64968436e6

View File

@ -349,17 +349,7 @@ _rpm_ostree_diff_package_lists (GPtrArray *a,
else
{
cmp = strcmp (pkg_a->arch, pkg_b->arch);
if (cmp < 0)
{
g_ptr_array_add (unique_a, g_object_ref (pkg_a));
cur_a++;
}
else if (cmp > 0)
{
g_ptr_array_add (unique_b, g_object_ref (pkg_b));
cur_b++;
}
else
if (cmp == 0)
{
cmp = dnf_sack_evr_cmp (sack, pkg_a->evr, pkg_b->evr);
if (cmp == 0)
@ -374,6 +364,19 @@ _rpm_ostree_diff_package_lists (GPtrArray *a,
cur_a++;
cur_b++;
}
else
{
if (cmp < 0)
{
g_ptr_array_add (unique_a, g_object_ref (pkg_a));
cur_a++;
}
else if (cmp > 0)
{
g_ptr_array_add (unique_b, g_object_ref (pkg_b));
cur_b++;
}
}
}
}