diff options
| author | 2019-03-16 04:41:34 -0400 | |
|---|---|---|
| committer | 2019-03-16 05:01:39 -0400 | |
| commit | f71c598907ea76095dd3e2a71d160ddbe5c6635c (patch) | |
| tree | c8d7816de761adcbeec2d9613c1fdd0046b180f7 | |
| parent | Merge pull request #2241 from lioncash/compile-flags (diff) | |
| download | yuzu-f71c598907ea76095dd3e2a71d160ddbe5c6635c.tar.gz yuzu-f71c598907ea76095dd3e2a71d160ddbe5c6635c.tar.xz yuzu-f71c598907ea76095dd3e2a71d160ddbe5c6635c.zip | |
common/thread_queue_list: Remove unnecessary dependency on boost
We really don't need to pull in several headers of boost related
machinery just to perform the erase-remove idiom (particularly with
C++20 around the corner, which adds universal container std::erase and
std::erase_if, which we can just use instead).
With this, we don't need to link in anything boost-related into common.
| -rw-r--r-- | src/common/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/common/thread_queue_list.h | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 3d30f0e3e..fecef967b 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -128,4 +128,4 @@ endif() | |||
| 128 | 128 | ||
| 129 | create_target_directory_groups(common) | 129 | create_target_directory_groups(common) |
| 130 | 130 | ||
| 131 | target_link_libraries(common PUBLIC Boost::boost fmt microprofile) | 131 | target_link_libraries(common PUBLIC fmt microprofile) |
diff --git a/src/common/thread_queue_list.h b/src/common/thread_queue_list.h index e7594db68..791f99a8c 100644 --- a/src/common/thread_queue_list.h +++ b/src/common/thread_queue_list.h | |||
| @@ -6,7 +6,6 @@ | |||
| 6 | 6 | ||
| 7 | #include <array> | 7 | #include <array> |
| 8 | #include <deque> | 8 | #include <deque> |
| 9 | #include <boost/range/algorithm_ext/erase.hpp> | ||
| 10 | 9 | ||
| 11 | namespace Common { | 10 | namespace Common { |
| 12 | 11 | ||
| @@ -111,8 +110,9 @@ struct ThreadQueueList { | |||
| 111 | } | 110 | } |
| 112 | 111 | ||
| 113 | void remove(Priority priority, const T& thread_id) { | 112 | void remove(Priority priority, const T& thread_id) { |
| 114 | Queue* cur = &queues[priority]; | 113 | Queue* const cur = &queues[priority]; |
| 115 | boost::remove_erase(cur->data, thread_id); | 114 | const auto iter = std::remove(cur->data.begin(), cur->data.end(), thread_id); |
| 115 | cur->data.erase(iter, cur->data.end()); | ||
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | void rotate(Priority priority) { | 118 | void rotate(Priority priority) { |