aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-07-03 22:57:53 +0530
committersinanmohd <sinan@sinanmohd.com>2024-07-03 22:57:58 +0530
commitf804e6bf5860a419cb20b7372d3f6d56461532dd (patch)
treee3c03bdebbe4bbd6fe5859ac75c8f02c29f35a3b
parent5602a17e4c916c1fe90a0025fbdceb0621e2e9ba (diff)
solver_greedy: select derivation with the least cost if conformity is same
-rw-r--r--src/solver_greedy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/solver_greedy.c b/src/solver_greedy.c
index 79472b5..215f678 100644
--- a/src/solver_greedy.c
+++ b/src/solver_greedy.c
@@ -66,6 +66,10 @@ int solver_greedy(struct job_clist *q, int32_t *max_build, struct job **job)
conformity_max = conformity_cur;
selected = j;
}
+ if (conformity_cur == conformity_max &&
+ selected->deps_filled > j->deps_filled) {
+ selected = j;
+ }
}
if (selected == NULL)