operand: Use pure virtual functions

This commit is contained in:
ReinUsesLisp
2019-11-01 06:07:53 -03:00
parent 4c2981eab5
commit b4eeadfd9b
8 changed files with 39 additions and 51 deletions

View File

@@ -19,15 +19,15 @@ void LiteralString::Fetch(Stream& stream) const {
stream.Write(string);
}
u16 LiteralString::GetWordCount() const {
u16 LiteralString::GetWordCount() const noexcept {
return static_cast<u16>(string.size() / 4 + 1);
}
bool LiteralString::operator==(const Operand& other) const {
if (GetType() == other.GetType()) {
return static_cast<const LiteralString&>(other).string == string;
bool LiteralString::operator==(const Operand& other) const noexcept {
if (!EqualType(other)) {
return false;
}
return false;
return static_cast<const LiteralString&>(other).string == string;
}
} // namespace Sirit