mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix: function returns by const value
This commit is contained in:
parent
d292ef130c
commit
a5dc187481
14 changed files with 41 additions and 28 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue