diff --git a/u01/node.cpp b/u01/node.cpp index b1ff337..0d3ce9c 100644 --- a/u01/node.cpp +++ b/u01/node.cpp @@ -29,7 +29,7 @@ node::~node() { std::string node::get_name() const { return name; } -void node::set_name(const std::string new_name) { this->name = new_name; } +void node::set_name(const std::string& new_name) { this->name = new_name; } std::size_t node::get_nr_children() const { return children.size(); } diff --git a/u01/node.h b/u01/node.h index def10b3..763081f 100644 --- a/u01/node.h +++ b/u01/node.h @@ -11,7 +11,7 @@ public: node(const std::string &name = ""); virtual ~node(); std::string get_name() const; - void set_name(const std::string new_name); + void set_name(const std::string &new_name); std::size_t get_nr_children() const; node *get_child(std::size_t i) const; void add_child(node *child);