Reduce amount of copies for HashedString for improved performance
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: Deukhoofd <deukhoofd@gmail.com>
This commit is contained in:
@@ -40,21 +40,21 @@ namespace Porygon::Evaluation {
|
||||
|
||||
const shared_ptr<EvalValue> IndexValue(EvalValue *val) const final {
|
||||
const auto stringKey = val->EvaluateString();
|
||||
return this->_table->at(Utilities::HashedString(stringKey));
|
||||
return this->_table->at(Utilities::HashedString::CreateLookup(stringKey));
|
||||
}
|
||||
|
||||
const shared_ptr<EvalValue> IndexValue(uint32_t hash) const final {
|
||||
return this->_table->at(Utilities::HashedString(hash));
|
||||
return this->_table->at(Utilities::HashedString::CreateLookup(hash));
|
||||
}
|
||||
|
||||
const shared_ptr<EvalValue> IndexValue(const char *val) const {
|
||||
auto hash = Utilities::HashedString::ConstHash(val);
|
||||
return this->_table->at(Utilities::HashedString(hash));
|
||||
return this->_table->at(Utilities::HashedString::CreateLookup(hash));
|
||||
}
|
||||
|
||||
void SetIndexValue(EvalValue *key, const shared_ptr<EvalValue> &value) const final {
|
||||
auto hash = key->GetHashCode();
|
||||
this->_table->at(Utilities::HashedString(hash)) = value;
|
||||
this->_table->at(Utilities::HashedString::CreateLookup(hash)) = value;
|
||||
}
|
||||
|
||||
const _Rb_tree_const_iterator<pair<const Utilities::HashedString, shared_ptr<EvalValue>>> GetTableIterator() const{
|
||||
|
||||
Reference in New Issue
Block a user