From 59b5851920040b5a7290d84a9bc007009ff4a2c6 Mon Sep 17 00:00:00 2001 From: Andreas Eknes Lie Date: Tue, 29 Aug 2023 13:50:06 +0200 Subject: [PATCH] Inline active_status --- src/clib/lib/job_queue/slurm_driver.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/clib/lib/job_queue/slurm_driver.cpp b/src/clib/lib/job_queue/slurm_driver.cpp index 17e6dc676ea..df872737fc4 100644 --- a/src/clib/lib/job_queue/slurm_driver.cpp +++ b/src/clib/lib/job_queue/slurm_driver.cpp @@ -43,10 +43,6 @@ class SlurmStatus { void new_job(int job_id) { this->update(job_id, JOB_QUEUE_PENDING); } - static bool active_status(job_status_type status) { - return (status == JOB_QUEUE_PENDING || status == JOB_QUEUE_RUNNING); - } - /** This function is used when the status of the jobs is updated with squeue. The semantics is as follows: @@ -75,7 +71,8 @@ class SlurmStatus { auto squeue_pair = squeue_jobs.find(job_id); if (squeue_pair == squeue_jobs.end()) { - if (this->active_status(job_status)) + if ((job_status == JOB_QUEUE_PENDING || + job_status == JOB_QUEUE_RUNNING)) active_jobs.push_back(job_id); } else this->jobs[job_id] = squeue_pair->second;