diff options
author | Rodrigo Locatti <reinuseslisp@airmail.cc> | 2020-09-23 01:37:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-23 01:37:51 +0200 |
commit | 2b863c9aa34e388f6c64665a2e7d8c808d598c26 (patch) | |
tree | 288ff1cc4677d6511ed8cc7e1b0db20ce2d2590f /src/video_core/shader/ast.h | |
parent | Merge pull request #4697 from lioncash/copy5 (diff) | |
parent | General: Make use of std::nullopt where applicable (diff) | |
download | yuzu-2b863c9aa34e388f6c64665a2e7d8c808d598c26.tar yuzu-2b863c9aa34e388f6c64665a2e7d8c808d598c26.tar.gz yuzu-2b863c9aa34e388f6c64665a2e7d8c808d598c26.tar.bz2 yuzu-2b863c9aa34e388f6c64665a2e7d8c808d598c26.tar.lz yuzu-2b863c9aa34e388f6c64665a2e7d8c808d598c26.tar.xz yuzu-2b863c9aa34e388f6c64665a2e7d8c808d598c26.tar.zst yuzu-2b863c9aa34e388f6c64665a2e7d8c808d598c26.zip |
Diffstat (limited to 'src/video_core/shader/ast.h')
-rw-r--r-- | src/video_core/shader/ast.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/video_core/shader/ast.h b/src/video_core/shader/ast.h index cca13bcde..8e5a22ab3 100644 --- a/src/video_core/shader/ast.h +++ b/src/video_core/shader/ast.h @@ -199,55 +199,48 @@ public: } std::optional<u32> GetGotoLabel() const { - auto inner = std::get_if<ASTGoto>(&data); - if (inner) { + if (const auto* inner = std::get_if<ASTGoto>(&data)) { return {inner->label}; } - return {}; + return std::nullopt; } Expr GetGotoCondition() const { - auto inner = std::get_if<ASTGoto>(&data); - if (inner) { + if (const auto* inner = std::get_if<ASTGoto>(&data)) { return inner->condition; } return nullptr; } void MarkLabelUnused() { - auto inner = std::get_if<ASTLabel>(&data); - if (inner) { + if (auto* inner = std::get_if<ASTLabel>(&data)) { inner->unused = true; } } bool IsLabelUnused() const { - auto inner = std::get_if<ASTLabel>(&data); - if (inner) { + if (const auto* inner = std::get_if<ASTLabel>(&data)) { return inner->unused; } return true; } std::optional<u32> GetLabelIndex() const { - auto inner = std::get_if<ASTLabel>(&data); - if (inner) { + if (const auto* inner = std::get_if<ASTLabel>(&data)) { return {inner->index}; } - return {}; + return std::nullopt; } Expr GetIfCondition() const { - auto inner = std::get_if<ASTIfThen>(&data); - if (inner) { + if (const auto* inner = std::get_if<ASTIfThen>(&data)) { return inner->condition; } return nullptr; } void SetGotoCondition(Expr new_condition) { - auto inner = std::get_if<ASTGoto>(&data); - if (inner) { + if (auto* inner = std::get_if<ASTGoto>(&data)) { inner->condition = std::move(new_condition); } } |