Unverified Commit 8cb63194 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer
Browse files

optimize utils::strmatch() by using const string reference

parent 814e2e9a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
+2 −2
Original line number Diff line number Diff line
@@ -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
     *