@@ -94,11 +94,11 @@ class Attributes : public ItemAttributeHelper {
9494 return type;
9595 }
9696
97- std::variant<int64_t , std::shared_ptr<std:: string> > getDefaultValueForType (ItemAttribute_t attributeType) const {
97+ std::variant<int64_t , std::string> getDefaultValueForType (ItemAttribute_t attributeType) const {
9898 if (ItemAttributeHelper::isAttributeInteger (attributeType)) {
9999 return 0 ;
100100 } else if (ItemAttributeHelper::isAttributeString (attributeType)) {
101- return std::make_shared<std:: string> ();
101+ return std::string ();
102102 } else {
103103 return {};
104104 }
@@ -110,8 +110,8 @@ class Attributes : public ItemAttributeHelper {
110110 }
111111 }
112112 void setValue (const std::string &newValue) {
113- if (std::holds_alternative<std::shared_ptr<std:: string> >(value)) {
114- value = std::make_shared<std::string>( newValue) ;
113+ if (std::holds_alternative<std::string>(value)) {
114+ value = newValue;
115115 }
116116 }
117117 const int64_t &getInteger () const {
@@ -122,17 +122,17 @@ class Attributes : public ItemAttributeHelper {
122122 return emptyValue;
123123 }
124124
125- std::shared_ptr<std:: string> getString () const {
126- if (std::holds_alternative<std::shared_ptr<std:: string> >(value)) {
127- return std::get<std::shared_ptr<std:: string> >(value);
125+ const std::string & getString () const {
126+ if (std::holds_alternative<std::string>(value)) {
127+ return std::get<std::string>(value);
128128 }
129- static std::shared_ptr<std:: string> emptyPtr ;
130- return emptyPtr ;
129+ static std::string emptyValue ;
130+ return emptyValue ;
131131 }
132132
133133private:
134134 ItemAttribute_t type;
135- std::variant<int64_t , std::shared_ptr<std:: string> > value;
135+ std::variant<int64_t , std::string> value;
136136};
137137
138138class ItemAttribute : public ItemAttributeHelper {
0 commit comments