Instantiates the Class variable earlier

Avoid the instantiation for every call
This commit is contained in:
Felipe Zimmerle
2017-01-18 09:13:34 -03:00
committed by Felipe Zimmerle
parent ba6b972ca8
commit 9a8fc3116a
2 changed files with 26 additions and 9 deletions

View File

@@ -33,10 +33,16 @@ namespace collection {
class Variable {
public:
Variable(const std::string *key) :
m_key(key),
m_value(),
m_dynamic_value(false),
m_dynamic(false) { }
Variable(const std::string *key, const std::string *value) :
m_key(key),
m_value(value),
m_dynamic_value(false) { }
m_dynamic_value(false),
m_dynamic(false) { }
~Variable() {
if (m_dynamic_value) {
@@ -47,6 +53,7 @@ class Variable {
const std::string *m_key;
const std::string *m_value;
bool m_dynamic_value;
bool m_dynamic;
};
} // namespace collection