aboutsummaryrefslogtreecommitdiff
path: root/src/jobs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/jobs.c')
-rw-r--r--src/jobs.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/jobs.c b/src/jobs.c
index 67df86f..3c17dc4 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -123,6 +123,20 @@ int job_parents_list_insert(struct job *job, struct job *parent)
return 0;
}
+int job_cost(struct job *job)
+{
+ int32_t builds = 0;
+
+ for (size_t i = 0; i < job->deps_filled; i++) {
+ if (job->deps[i]->insubstituters)
+ continue;
+
+ builds++;
+ }
+
+ return builds;
+}
+
static int job_output_insert(struct job *j, char *name, char *store_path)
{
struct output *o;