From 53d572ae7d58a15dd402982632cc00bf8382ee3c Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Fri, 1 Nov 2019 05:44:27 -0300 Subject: [PATCH] Drop usage of dynamic_cast in favour of static_cast --- src/literal_string.cpp | 2 +- src/op.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/literal_string.cpp b/src/literal_string.cpp index 7a820d3..b81e83b 100644 --- a/src/literal_string.cpp +++ b/src/literal_string.cpp @@ -26,7 +26,7 @@ u16 LiteralString::GetWordCount() const { bool LiteralString::operator==(const Operand& other) const { if (operand_type == other.GetType()) { - return dynamic_cast(other).string == string; + return static_cast(other).string == string; } return false; } diff --git a/src/op.cpp b/src/op.cpp index 8b50600..f48316b 100644 --- a/src/op.cpp +++ b/src/op.cpp @@ -35,7 +35,7 @@ bool Op::operator==(const Operand& other) const { if (operand_type != other.GetType()) { return false; } - const Op& op = dynamic_cast(other); + const auto& op = static_cast(other); if (op.opcode == opcode && result_type == op.result_type && operands.size() == op.operands.size()) { for (std::size_t i = 0; i < operands.size(); i++) {