]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Simplify infarch rule generation
authorMichael Schroeder <mls@suse.de>
Wed, 22 Jan 2020 11:56:21 +0000 (12:56 +0100)
committerMichael Schroeder <mls@suse.de>
Wed, 22 Jan 2020 11:56:21 +0000 (12:56 +0100)
If bestscore is zero, badq will always be empty.

src/rules.c

index e31fe01b36fcda5842eefb58233cbae96163306c..f735e5d2277186faa6288c0e42ba2e10cb6b5275 100644 (file)
@@ -1656,13 +1656,16 @@ solver_addinfarchrules(Solver *solv, Map *addedmap)
            }
        }
       if (first)
-       continue;
+       continue;               /* not the first in the group */
+
+      if (!bestscore)
+       continue;               /* did not find a score for this group */
 
       /* speed up common case where installed package already has best arch */
       if (allowedarchs.count == 1 && bests && allowedarchs.elements[0] == bests->arch)
        allowedarchs.count--;   /* installed arch is best */
 
-      if (allowedarchs.count && pool->implicitobsoleteusescolors && installed && bestscore)
+      if (allowedarchs.count && pool->implicitobsoleteusescolors && installed)
        {
          /* need an extra pass for lockstep checking: we only allow to keep an inferior arch
           * if the corresponding installed package is not lock-stepped */
@@ -1707,7 +1710,7 @@ solver_addinfarchrules(Solver *solv, Map *addedmap)
          if (ps->name != s->name || !MAPTST(addedmap, p))
            continue;
          a = pool_arch2score(pool, ps->arch);
-         if (a != 1 && bestscore && ((a ^ bestscore) & 0xffff0000) != 0)
+         if (a != 1 && ((a ^ bestscore) & 0xffff0000) != 0)
            {
              if (installed && ps->repo == installed)
                {