summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/frontend/maxwell/control_flow.cpp
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-07-12 10:22:01 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:40 +0200
commitbf2956d77ab0ad06c4b5505cc9906e51e5878274 (patch)
tree3aae336c0dc3fe65351d5e6e312a214351e2e2fc /src/shader_recompiler/frontend/maxwell/control_flow.cpp
parentglsl: Clamp shared mem size to GL_MAX_COMPUTE_SHARED_MEMORY_SIZE (diff)
downloadyuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.tar
yuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.tar.gz
yuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.tar.bz2
yuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.tar.lz
yuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.tar.xz
yuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.tar.zst
yuzu-bf2956d77ab0ad06c4b5505cc9906e51e5878274.zip
Diffstat (limited to 'src/shader_recompiler/frontend/maxwell/control_flow.cpp')
-rw-r--r--src/shader_recompiler/frontend/maxwell/control_flow.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/shader_recompiler/frontend/maxwell/control_flow.cpp b/src/shader_recompiler/frontend/maxwell/control_flow.cpp
index e7abea82f..1a954a509 100644
--- a/src/shader_recompiler/frontend/maxwell/control_flow.cpp
+++ b/src/shader_recompiler/frontend/maxwell/control_flow.cpp
@@ -5,7 +5,6 @@
#include <algorithm>
#include <array>
#include <optional>
-#include <ranges>
#include <string>
#include <utility>
@@ -151,18 +150,18 @@ std::pair<Location, Stack> Stack::Pop(Token token) const {
}
std::optional<Location> Stack::Peek(Token token) const {
- const auto reverse_entries{entries | std::views::reverse};
- const auto it{std::ranges::find(reverse_entries, token, &StackEntry::token)};
- if (it == reverse_entries.end()) {
+ const auto it{std::find_if(entries.rbegin(), entries.rend(),
+ [token](const auto& entry) { return entry.token == token; })};
+ if (it == entries.rend()) {
return std::nullopt;
}
return it->target;
}
Stack Stack::Remove(Token token) const {
- const auto reverse_entries{entries | std::views::reverse};
- const auto it{std::ranges::find(reverse_entries, token, &StackEntry::token)};
- const auto pos{std::distance(reverse_entries.begin(), it)};
+ const auto it{std::find_if(entries.rbegin(), entries.rend(),
+ [token](const auto& entry) { return entry.token == token; })};
+ const auto pos{std::distance(entries.rbegin(), it)};
Stack result;
result.entries.insert(result.entries.end(), entries.begin(), entries.end() - pos - 1);
return result;