From 121991b98c1f61090210bc4d1d6cc0bced83ed0e Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Sun, 11 Nov 2018 16:57:30 -0800 Subject: [PATCH] Revert "Convert job list to a dequeue" This reverts commit 54050bd4c5f510eeb8b1cbb86585e31233427e63. Type job_list_t was changed from a list to a deque in commit 54050bd4c5f510eeb8b1cbb86585e31233427e63. In process_clean_after_marking(), we remove jobs while iterating. dequeues do not support that. Make it a list again. --- src/parser.cpp | 2 +- src/proc.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/parser.cpp b/src/parser.cpp index 8480ecd0b..dfa69f5dc 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -591,7 +591,7 @@ void parser_t::job_promote(job_t *job) { assert(loc != my_job_list.end()); // Move the job to the beginning. - std::rotate(my_job_list.begin(), loc, my_job_list.end()); + my_job_list.splice(my_job_list.begin(), my_job_list, loc); } job_t *parser_t::job_get(job_id_t id) { diff --git a/src/proc.h b/src/proc.h index d1de80641..645e40ed5 100644 --- a/src/proc.h +++ b/src/proc.h @@ -11,7 +11,7 @@ #include #include -#include +#include #include #include @@ -295,7 +295,7 @@ extern bool is_login; extern int is_event; // List of jobs. We sometimes mutate this while iterating - hence it must be a list, not a vector -typedef std::deque> job_list_t; +typedef std::list> job_list_t; bool job_list_is_empty(void);