Make a lot of one-liner functions inline
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
@@ -26,39 +26,39 @@ namespace Porygon::Evaluation {
|
||||
{
|
||||
}
|
||||
|
||||
const TypeClass GetTypeClass() const final {
|
||||
inline const TypeClass GetTypeClass() const final {
|
||||
return TypeClass::Table;
|
||||
}
|
||||
|
||||
const size_t GetHashCode() const final {
|
||||
inline const size_t GetHashCode() const final {
|
||||
return _hash;
|
||||
}
|
||||
|
||||
const bool operator==(EvalValue *b) const final {
|
||||
inline const bool operator==(EvalValue *b) const final {
|
||||
return this->_hash == b->GetHashCode();
|
||||
}
|
||||
|
||||
const shared_ptr<EvalValue> Clone() const final {
|
||||
inline const shared_ptr<EvalValue> Clone() const final {
|
||||
return shared_ptr<EvalValue>(new NumericalTableEvalValue(_table, _hash));
|
||||
}
|
||||
|
||||
const shared_ptr<EvalValue> IndexValue(EvalValue *val) const final {
|
||||
inline const shared_ptr<EvalValue> IndexValue(EvalValue *val) const final {
|
||||
const auto index = val->EvaluateInteger() - 1;
|
||||
return this->_table->at(index);
|
||||
}
|
||||
|
||||
const shared_ptr<EvalValue> IndexValue(uint32_t hash) const final {
|
||||
inline const shared_ptr<EvalValue> IndexValue(uint32_t hash) const final {
|
||||
return this->_table->at(hash - 1);
|
||||
}
|
||||
|
||||
void SetIndexValue(EvalValue *key, const shared_ptr<EvalValue> &value) const final {
|
||||
inline void SetIndexValue(EvalValue *key, const shared_ptr<EvalValue> &value) const final {
|
||||
auto index = key->EvaluateInteger();
|
||||
this->_table->at(index - 1) = value;
|
||||
}
|
||||
|
||||
Iterator * GetKeyIterator() const final;
|
||||
|
||||
const shared_ptr<vector<shared_ptr<EvalValue>>> GetTable() const{
|
||||
inline const shared_ptr<vector<shared_ptr<EvalValue>>> GetTable() const{
|
||||
return _table;
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user