From 64968436e6ca4f7d98e936feccd969e615f0cf0d Mon Sep 17 00:00:00 2001 From: Jonathan Lebon Date: Mon, 26 Feb 2018 21:40:54 +0000 Subject: [PATCH] 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 --- src/lib/rpmostree-package.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/lib/rpmostree-package.c b/src/lib/rpmostree-package.c index 14139543..17e253f0 100644 --- a/src/lib/rpmostree-package.c +++ b/src/lib/rpmostree-package.c @@ -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++; + } + } } }