Work on performance improvements
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-06-13 16:26:10 +02:00
parent e93bcab14d
commit 1cb65f17c9
19 changed files with 84 additions and 108 deletions

View File

@@ -11,19 +11,18 @@ using namespace std;
class StringEvalValue : public EvalValue{
string _value;
size_t _hash;
std::shared_ptr<ScriptType> _type;
public:
explicit StringEvalValue(string s){
_value = move(s);
_hash = HashedString::ConstHash (_value.c_str());
_type = std::make_shared<StringScriptType>(true, _hash);
}
std::shared_ptr<ScriptType> GetType() final{
return _type;
};
const TypeClass GetTypeClass() final{
return TypeClass ::String;
}
bool operator ==(EvalValue* b) final{
if (b->GetType()->GetClass() != TypeClass::String)
if (b->GetTypeClass() != TypeClass::String)
return false;
return this->_hash == b->GetHashCode();
};