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:
@@ -67,11 +67,11 @@ void Porygon::Script::Parse(const u16string& script) {
|
||||
}
|
||||
|
||||
EvalValue *Porygon::Script::GetVariable(const u16string &key) {
|
||||
return _scriptVariables -> at(HashedString(key)).get();
|
||||
return _scriptVariables -> at(HashedString::CreateLookup(key)).get();
|
||||
}
|
||||
|
||||
bool Porygon::Script::HasVariable(const u16string &key) {
|
||||
auto f = _scriptVariables->find(HashedString(key));
|
||||
auto f = _scriptVariables->find(HashedString::CreateLookup(key));
|
||||
return f != _scriptVariables->end();
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ EvalValue *Porygon::Script::GetLastValue() {
|
||||
}
|
||||
|
||||
bool Porygon::Script::HasFunction(const u16string &key) {
|
||||
auto f = _scriptVariables->find(HashedString(key));
|
||||
auto f = _scriptVariables->find(HashedString::CreateLookup(key));
|
||||
return f != _scriptVariables->end() && f.operator->()->second->GetTypeClass() == TypeClass ::Function;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user