From f80f6e214de0e7753a2bce39032e43377c37b063 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Fri, 11 Mar 2016 18:59:38 +0300 Subject: [PATCH] Removed unnecessary copy. --- editor/xml_feature.cpp | 6 +++--- editor/xml_feature.hpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/editor/xml_feature.cpp b/editor/xml_feature.cpp index dcfb0ca379..0f0b24c8d5 100644 --- a/editor/xml_feature.cpp +++ b/editor/xml_feature.cpp @@ -310,14 +310,14 @@ string XMLFeature::GetTagValue(string const & key) const return tag.attribute("v").value(); } -void XMLFeature::SetTagValue(string const & key, string const value) +void XMLFeature::SetTagValue(string const & key, string const & value) { auto tag = FindTag(m_document, key); if (!tag) { tag = GetRootNode().append_child("tag"); - tag.append_attribute("k") = key.data(); - tag.append_attribute("v") = value.data(); + tag.append_attribute("k").set_value(key.c_str()); + tag.append_attribute("v").set_value(value.c_str()); } else { diff --git a/editor/xml_feature.hpp b/editor/xml_feature.hpp index 45f94af5a4..09043e9f75 100644 --- a/editor/xml_feature.hpp +++ b/editor/xml_feature.hpp @@ -150,7 +150,7 @@ public: } string GetTagValue(string const & key) const; - void SetTagValue(string const & key, string const value); + void SetTagValue(string const & key, string const & value); string GetAttribute(string const & key) const; void SetAttribute(string const & key, string const & value);