Mark evalValues as const
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -17,11 +17,11 @@ public:
|
||||
_hash = HashedString::ConstHash (_value.c_str());
|
||||
}
|
||||
|
||||
const TypeClass GetTypeClass() final{
|
||||
const TypeClass GetTypeClass() const final{
|
||||
return TypeClass ::String;
|
||||
}
|
||||
|
||||
bool operator ==(EvalValue* b) final{
|
||||
const bool operator ==(EvalValue* b) const final{
|
||||
if (b->GetTypeClass() != TypeClass::String)
|
||||
return false;
|
||||
return this->_hash == b->GetHashCode();
|
||||
@@ -31,17 +31,17 @@ public:
|
||||
return &_value;
|
||||
}
|
||||
|
||||
shared_ptr<EvalValue> Clone() final{
|
||||
const shared_ptr<EvalValue> Clone() const final{
|
||||
return make_shared<StringEvalValue>(_value);
|
||||
}
|
||||
|
||||
shared_ptr<EvalValue> IndexValue(EvalValue* val) final{
|
||||
const shared_ptr<EvalValue> IndexValue(EvalValue* val) const final{
|
||||
// Porygon is 1-indexed, so we convert to that.
|
||||
auto l = val->EvaluateInteger() - 1;
|
||||
return make_shared<StringEvalValue>(u16string(1, _value[l]));
|
||||
}
|
||||
|
||||
std::size_t GetHashCode() final{
|
||||
const std::size_t GetHashCode() const final{
|
||||
return _hash;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user