diff options
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/thread_queue_list.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/thread_queue_list.h b/src/common/thread_queue_list.h index 38a450d69..133122c5f 100644 --- a/src/common/thread_queue_list.h +++ b/src/common/thread_queue_list.h | |||
| @@ -16,7 +16,7 @@ struct ThreadQueueList { | |||
| 16 | // (dynamically resizable) circular buffers to remove their overhead when | 16 | // (dynamically resizable) circular buffers to remove their overhead when |
| 17 | // inserting and popping. | 17 | // inserting and popping. |
| 18 | 18 | ||
| 19 | typedef unsigned int Priority; | 19 | using Priority = unsigned int; |
| 20 | 20 | ||
| 21 | // Number of priority levels. (Valid levels are [0..NUM_QUEUES).) | 21 | // Number of priority levels. (Valid levels are [0..NUM_QUEUES).) |
| 22 | static const Priority NUM_QUEUES = N; | 22 | static const Priority NUM_QUEUES = N; |
| @@ -26,9 +26,9 @@ struct ThreadQueueList { | |||
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | // Only for debugging, returns priority level. | 28 | // Only for debugging, returns priority level. |
| 29 | Priority contains(const T& uid) { | 29 | Priority contains(const T& uid) const { |
| 30 | for (Priority i = 0; i < NUM_QUEUES; ++i) { | 30 | for (Priority i = 0; i < NUM_QUEUES; ++i) { |
| 31 | Queue& cur = queues[i]; | 31 | const Queue& cur = queues[i]; |
| 32 | if (std::find(cur.data.cbegin(), cur.data.cend(), uid) != cur.data.cend()) { | 32 | if (std::find(cur.data.cbegin(), cur.data.cend(), uid) != cur.data.cend()) { |
| 33 | return i; | 33 | return i; |
| 34 | } | 34 | } |
| @@ -37,8 +37,8 @@ struct ThreadQueueList { | |||
| 37 | return -1; | 37 | return -1; |
| 38 | } | 38 | } |
| 39 | 39 | ||
| 40 | T get_first() { | 40 | T get_first() const { |
| 41 | Queue* cur = first; | 41 | const Queue* cur = first; |
| 42 | while (cur != nullptr) { | 42 | while (cur != nullptr) { |
| 43 | if (!cur->data.empty()) { | 43 | if (!cur->data.empty()) { |
| 44 | return cur->data.front(); | 44 | return cur->data.front(); |