Work on performance improvements
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:
@@ -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();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user