literal_number: Drop usage of RTTI

This commit is contained in:
ReinUsesLisp 2019-11-01 05:41:58 -03:00
parent de91660f3c
commit cff0a41416
2 changed files with 7 additions and 10 deletions

View file

@ -9,7 +9,7 @@
namespace Sirit {
LiteralNumber::LiteralNumber(std::type_index type) : type(type) {
LiteralNumber::LiteralNumber(u64 raw, bool is_32) : raw{raw}, is_32{is_32} {
operand_type = OperandType::Number;
}
@ -30,7 +30,7 @@ u16 LiteralNumber::GetWordCount() const {
bool LiteralNumber::operator==(const Operand& other) const {
if (operand_type == other.GetType()) {
const auto& o{static_cast<const LiteralNumber&>(other)};
return o.type == type && o.raw == raw;
return o.raw == raw && o.is_32 == is_32;
}
return false;
}