diff --git a/src/utils.cpp b/src/utils.cpp index 4efa35a8d1..7e1229dc0f 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -82,7 +82,7 @@ using namespace LAMMPS_NS; * even with char * type variables. * Example: utils::strmatch(text, std::string("^") + charptr) */ -bool utils::strmatch(std::string text, std::string pattern) +bool utils::strmatch(const std::string &text, const std::string &pattern) { const int pos = re_match(text.c_str(),pattern.c_str()); return (pos >= 0); diff --git a/src/utils.h b/src/utils.h index abaa87ca5f..91001c0fb0 100644 --- a/src/utils.h +++ b/src/utils.h @@ -35,7 +35,7 @@ namespace LAMMPS_NS { * \param pattern the search pattern, which may contain regexp markers * \return true if the pattern matches, false if not */ - bool strmatch(std::string text, std::string pattern); + bool strmatch(const std::string &text, const std::string &pattern); /** \brief Send message to screen and logfile, if available * @@ -148,7 +148,7 @@ namespace LAMMPS_NS { * \param line string that should be trimmed * \return new string without comment (string) */ - std::string trim_comment(const std::string & line); + std::string trim_comment(const std::string &line); /** * \brief Count words in string