]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Use solver_problem2str() convenience function in the demo solver
authorMichael Schroeder <mls@suse.de>
Wed, 21 Dec 2022 13:18:16 +0000 (14:18 +0100)
committerMichael Schroeder <mls@suse.de>
Wed, 21 Dec 2022 13:18:16 +0000 (14:18 +0100)
examples/solv/solv.c

index f7c0468b99ab9a0afef76745cc66e6664144c78d..223953067745bb83daf223418d34747b81de0f15 100644 (file)
@@ -788,16 +788,7 @@ rerunsolver:
       for (problem = 1; problem <= pcnt; problem++)
        {
          int take = 0;
-         Id rid;
-         printf("Problem %d/%d:\n", problem, pcnt);
-         rid = solver_findproblemrule(solv, problem);
-         if (rid)
-           {
-             Id source, target, dep;
-             SolverRuleinfo type = solver_ruleinfo(solv, rid, &source, &target, &dep);
-             printf("%s\n", solver_problemruleinfo2str(solv, type, source, target, dep));
-           }
-         printf("\n");
+         printf("Problem %d/%d:\n%s\n\n", problem, pcnt, solver_problem2str(solv, problem));
          scnt = solver_solution_count(solv, problem);
          for (solution = 1; solution <= scnt; solution++)
            {