1
0
Fork 0
mirror of https://git.suyu.dev/suyu/sirit.git synced 2024-12-23 04:32:04 +00:00

Drop usage of dynamic_cast in favour of static_cast

This commit is contained in:
ReinUsesLisp 2019-11-01 05:44:27 -03:00
parent cff0a41416
commit 53d572ae7d
2 changed files with 2 additions and 2 deletions

View file

@ -26,7 +26,7 @@ u16 LiteralString::GetWordCount() const {
bool LiteralString::operator==(const Operand& other) const { bool LiteralString::operator==(const Operand& other) const {
if (operand_type == other.GetType()) { if (operand_type == other.GetType()) {
return dynamic_cast<const LiteralString&>(other).string == string; return static_cast<const LiteralString&>(other).string == string;
} }
return false; return false;
} }

View file

@ -35,7 +35,7 @@ bool Op::operator==(const Operand& other) const {
if (operand_type != other.GetType()) { if (operand_type != other.GetType()) {
return false; return false;
} }
const Op& op = dynamic_cast<const Op&>(other); const auto& op = static_cast<const Op&>(other);
if (op.opcode == opcode && result_type == op.result_type && if (op.opcode == opcode && result_type == op.result_type &&
operands.size() == op.operands.size()) { operands.size() == op.operands.size()) {
for (std::size_t i = 0; i < operands.size(); i++) { for (std::size_t i = 0; i < operands.size(); i++) {