diff --git a/src/parser.cpp b/src/parser.cpp index 2a94a6b8e..d6751dac0 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -580,7 +580,7 @@ void parser_t::job_promote(job_t *job) { assert(loc != my_job_list.end()); // Move the job to the beginning. - my_job_list.splice(my_job_list.begin(), my_job_list, loc); + std::rotate(my_job_list.begin(), loc, my_job_list.end()); } job_t *parser_t::job_get(job_id_t id) { diff --git a/src/proc.cpp b/src/proc.cpp index 2f0dc6b12..b556d1cc5 100644 --- a/src/proc.cpp +++ b/src/proc.cpp @@ -475,7 +475,7 @@ static bool process_clean_after_marking(bool allow_interactive) { bool erased = false; const bool only_one_job = jobs().size() == 1; - for (auto itr = jobs().begin(); itr != jobs().end(); itr = (erased ? itr : (std::advance(itr, 1), itr)), erased = false) { + for (auto itr = jobs().begin(); itr != jobs().end(); itr = erased ? itr : itr + 1, erased = false) { job_t *j = itr->get(); // If we are reaping only jobs who do not need status messages sent to the console, do not // consider reaping jobs that need status messages. diff --git a/src/proc.h b/src/proc.h index dbc899a44..e7106dabe 100644 --- a/src/proc.h +++ b/src/proc.h @@ -12,7 +12,7 @@ #include #include -#include +#include #include #include @@ -451,8 +451,8 @@ extern bool is_login; /// nesting level. extern int is_event; -// List of jobs. We sometimes mutate this while iterating - hence it must be a list, not a vector -typedef std::list> job_list_t; +// List of jobs. +typedef std::deque> job_list_t; bool job_list_is_empty(void);