aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2024-07-24 22:26:12 +0530
committersinanmohd <sinan@sinanmohd.com>2024-07-24 22:26:12 +0530
commita6a2e54df6cc1f716ac32f0435fcaa1f1424521e (patch)
treea11c01f142ac5b81f3768f51209b68c2e38686fd /src
parentb9846396dee20efe322d64971ee6d6fe2bc8829b (diff)
jobs: job_cost -> job_cost_recursive
Diffstat (limited to 'src')
-rw-r--r--src/jobs.c2
-rw-r--r--src/solver_greedy.c12
2 files changed, 7 insertions, 7 deletions
diff --git a/src/jobs.c b/src/jobs.c
index 909ef1b..991d21b 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -123,7 +123,7 @@ int job_parents_list_insert(struct job *job, struct job *parent)
return 0;
}
-int job_cost(struct job *job)
+int job_cost_recursive(struct job *job)
{
int32_t builds = 1;
diff --git a/src/solver_greedy.c b/src/solver_greedy.c
index 160a035..4fcea00 100644
--- a/src/solver_greedy.c
+++ b/src/solver_greedy.c
@@ -43,8 +43,8 @@ static void solver_report(struct job *job, int32_t resources)
return;
job->reported = true;
- printf("❌ cost: %2d > %2d <-> %s -> %s\n", job_cost(job), resources,
- job->name, job->drv_path);
+ printf("❌ cost: %2d > %2d <-> %s -> %s\n", job_cost_recursive(job),
+ resources, job->name, job->drv_path);
for (size_t i = 0; i < job->parents_filled; i++)
solver_report(job->parents[i], resources);
@@ -61,7 +61,7 @@ int solver_greedy(struct job **job, struct job_clist *q, int32_t resources)
CIRCLEQ_FOREACH (j, q, clist) {
if (j->stale) {
continue;
- } else if (job_cost(j) > resources) {
+ } else if (job_cost_recursive(j) > resources) {
job_stale_set(j);
solver_report(j, resources);
continue;
@@ -83,13 +83,13 @@ int solver_greedy(struct job **job, struct job_clist *q, int32_t resources)
if (!evanix_opts.solver_report)
continue;
- printf("ℹ️ cost: %2d, conformity: %.2f -> %s\n", job_cost(j),
- conformity_cur, j->drv_path);
+ printf("ℹ️ cost: %2d, conformity: %.2f -> %s\n",
+ job_cost_recursive(j), conformity_cur, j->drv_path);
}
if (selected == NULL)
return -ESRCH;
*job = selected;
- return job_cost(selected);
+ return job_cost_recursive(selected);
}