diff --git a/opm/core/WellCollection.cpp b/opm/core/WellCollection.cpp index 1fd954d4c..b09e47df2 100644 --- a/opm/core/WellCollection.cpp +++ b/opm/core/WellCollection.cpp @@ -69,7 +69,7 @@ namespace Opm return leaf_nodes_; } - WellsGroupInterface* WellCollection::findNode(std::string name) + WellsGroupInterface* WellCollection::findNode(const std::string& name) { for (size_t i = 0; i < roots_.size(); i++) { @@ -81,7 +81,7 @@ namespace Opm return NULL; } - const WellsGroupInterface* WellCollection::findNode(std::string name) const + const WellsGroupInterface* WellCollection::findNode(const std::string& name) const { for (size_t i = 0; i < roots_.size(); i++) { diff --git a/opm/core/WellCollection.hpp b/opm/core/WellCollection.hpp index 640f26670..595ef7ce7 100644 --- a/opm/core/WellCollection.hpp +++ b/opm/core/WellCollection.hpp @@ -79,12 +79,12 @@ namespace Opm /// Finds the group with the given name. /// \param[in] the name of the group /// \return the pointer to the group if found, NULL otherwise - WellsGroupInterface* findNode(std::string name); + WellsGroupInterface* findNode(const std::string& name); /// Finds the group with the given name. /// \param[in] the name of the group /// \return the pointer to the group if found, NULL otherwise - const WellsGroupInterface* findNode(std::string name) const; + const WellsGroupInterface* findNode(const std::string& name) const; private: // To account for the possibility of a forest diff --git a/opm/core/WellsGroup.cpp b/opm/core/WellsGroup.cpp index a048e5017..6c8649a63 100644 --- a/opm/core/WellsGroup.cpp +++ b/opm/core/WellsGroup.cpp @@ -90,7 +90,7 @@ namespace Opm return injection_specification_; } - WellsGroupInterface* WellsGroup::findGroup(std::string name_of_node) + WellsGroupInterface* WellsGroup::findGroup(const std::string& name_of_node) { if (name() == name_of_node) { return this; @@ -288,7 +288,7 @@ namespace Opm return true; } - WellsGroupInterface* WellNode::findGroup(std::string name_of_node) + WellsGroupInterface* WellNode::findGroup(const std::string& name_of_node) { if (name() == name_of_node) { return this; diff --git a/opm/core/WellsGroup.hpp b/opm/core/WellsGroup.hpp index bfc25c406..5cf1ae74d 100644 --- a/opm/core/WellsGroup.hpp +++ b/opm/core/WellsGroup.hpp @@ -54,7 +54,7 @@ namespace Opm /// \returns the pointer to the WellsGroupInterface with the given name. NULL if /// the name is not found.a - virtual WellsGroupInterface* findGroup(std::string name_of_node) = 0; + virtual WellsGroupInterface* findGroup(const std::string& name_of_node) = 0; /// Sets the parent /// \param[in] parent the pointer to the parent @@ -125,7 +125,7 @@ namespace Opm ProductionSpecification prod_spec, InjectionSpecification inj_spec); - virtual WellsGroupInterface* findGroup(std::string name_of_node); + virtual WellsGroupInterface* findGroup(const std::string& name_of_node); void addChild(std::tr1::shared_ptr child); @@ -154,7 +154,7 @@ namespace Opm ProductionSpecification prod_spec, InjectionSpecification inj_spec); - virtual WellsGroupInterface* findGroup(std::string name_of_node); + virtual WellsGroupInterface* findGroup(const std::string& name_of_node); virtual bool conditionsMet(const std::vector& well_bhp, const std::vector& well_rate, WellPhasesSummed& summed_phases,