summaryrefslogtreecommitdiffstats
path: root/src/common/thread_queue_list.h
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-08-14 15:38:45 +0200
committerLioncash <mathew1800@gmail.com>2020-08-15 23:17:52 +0200
commitdf7248039553b3ebd338380c3ef0428b0e046e79 (patch)
treeeca7153300e311ac7954f5c085fdada0c7295699 /src/common/thread_queue_list.h
parentMerge pull request #4526 from lioncash/core-semi (diff)
downloadyuzu-df7248039553b3ebd338380c3ef0428b0e046e79.tar
yuzu-df7248039553b3ebd338380c3ef0428b0e046e79.tar.gz
yuzu-df7248039553b3ebd338380c3ef0428b0e046e79.tar.bz2
yuzu-df7248039553b3ebd338380c3ef0428b0e046e79.tar.lz
yuzu-df7248039553b3ebd338380c3ef0428b0e046e79.tar.xz
yuzu-df7248039553b3ebd338380c3ef0428b0e046e79.tar.zst
yuzu-df7248039553b3ebd338380c3ef0428b0e046e79.zip
Diffstat (limited to 'src/common/thread_queue_list.h')
-rw-r--r--src/common/thread_queue_list.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/thread_queue_list.h b/src/common/thread_queue_list.h
index 791f99a8c..def9e5d8d 100644
--- a/src/common/thread_queue_list.h
+++ b/src/common/thread_queue_list.h
@@ -18,14 +18,14 @@ struct ThreadQueueList {
using Priority = unsigned int;
// Number of priority levels. (Valid levels are [0..NUM_QUEUES).)
- static const Priority NUM_QUEUES = N;
+ static constexpr Priority NUM_QUEUES = N;
ThreadQueueList() {
first = nullptr;
}
// Only for debugging, returns priority level.
- Priority contains(const T& uid) const {
+ [[nodiscard]] Priority contains(const T& uid) const {
for (Priority i = 0; i < NUM_QUEUES; ++i) {
const Queue& cur = queues[i];
if (std::find(cur.data.cbegin(), cur.data.cend(), uid) != cur.data.cend()) {
@@ -36,7 +36,7 @@ struct ThreadQueueList {
return -1;
}
- T get_first() const {
+ [[nodiscard]] T get_first() const {
const Queue* cur = first;
while (cur != nullptr) {
if (!cur->data.empty()) {
@@ -49,7 +49,7 @@ struct ThreadQueueList {
}
template <typename UnaryPredicate>
- T get_first_filter(UnaryPredicate filter) const {
+ [[nodiscard]] T get_first_filter(UnaryPredicate filter) const {
const Queue* cur = first;
while (cur != nullptr) {
if (!cur->data.empty()) {
@@ -129,7 +129,7 @@ struct ThreadQueueList {
first = nullptr;
}
- bool empty(Priority priority) const {
+ [[nodiscard]] bool empty(Priority priority) const {
const Queue* cur = &queues[priority];
return cur->data.empty();
}