fix: function returns by const value

This commit is contained in:
MihailRis
2024-06-07 15:17:32 +03:00
parent d292ef130c
commit a5dc187481
14 changed files with 41 additions and 28 deletions
+2 -2
View File
@@ -120,7 +120,7 @@ const std::string& Node::getTag() const {
return tag;
}
const xmlattribute Node::attr(const std::string& name) const {
const xmlattribute& Node::attr(const std::string& name) const {
auto found = attrs.find(name);
if (found == attrs.end()) {
throw std::runtime_error("element <"+tag+" ...> missing attribute "+name);
@@ -128,7 +128,7 @@ const xmlattribute Node::attr(const std::string& name) const {
return found->second;
}
const xmlattribute Node::attr(const std::string& name, const std::string& def) const {
xmlattribute Node::attr(const std::string& name, const std::string& def) const {
auto found = attrs.find(name);
if (found == attrs.end()) {
return Attribute(name, def);