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:
@@ -11,7 +11,7 @@
|
||||
#include "Parser/Parser.hpp"
|
||||
#include "Binder/Binder.hpp"
|
||||
|
||||
Porygon::Script* Porygon::Script::Create(const u16string& script) {
|
||||
inline Porygon::Script* Porygon::Script::Create(const u16string& script) {
|
||||
return new Script(script);
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ std::u16string To_UTF16(const string &s)
|
||||
std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t> conv;
|
||||
return conv.from_bytes(s);
|
||||
}
|
||||
Porygon::Script *Porygon::Script::Create(const string &script) {
|
||||
inline Porygon::Script *Porygon::Script::Create(const string &script) {
|
||||
return Script::Create(To_UTF16(script));
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ void Porygon::Script::Parse(const u16string& script) {
|
||||
delete parseResult;
|
||||
}
|
||||
|
||||
EvalValue *Porygon::Script::GetVariable(const u16string &key) {
|
||||
inline EvalValue *Porygon::Script::GetVariable(const u16string &key) {
|
||||
return _scriptVariables -> at(HashedString::CreateLookup(key)).get();
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ bool Porygon::Script::HasVariable(const u16string &key) {
|
||||
return f != _scriptVariables->end();
|
||||
}
|
||||
|
||||
EvalValue *Porygon::Script::GetLastValue() {
|
||||
inline EvalValue *Porygon::Script::GetLastValue() {
|
||||
return _evaluator->GetLastValue();
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ bool Porygon::Script::HasFunction(const u16string &key) {
|
||||
return f != _scriptVariables->end() && f.operator->()->second->GetTypeClass() == TypeClass ::Function;
|
||||
}
|
||||
|
||||
shared_ptr<EvalValue> Porygon::Script::CallFunction(const u16string &key, const vector<EvalValue *>& variables) {
|
||||
inline shared_ptr<EvalValue> Porygon::Script::CallFunction(const u16string &key, const vector<EvalValue *>& variables) {
|
||||
auto var = (GenericFunctionEvalValue*)GetVariable(key);
|
||||
return this->_evaluator->EvaluateFunction(var, variables);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user