use call-by-value with std::move() function

This commit is contained in:
Axel Kohlmeyer
2021-10-14 01:21:54 -04:00
parent e56cc9be00
commit 2106075320
4 changed files with 7 additions and 6 deletions

View File

@ -49,8 +49,8 @@ TokenizerException::TokenizerException(const std::string &msg, const std::string
* \param str string to be processed
* \param _separators string with separator characters (default: " \t\r\n\f") */
Tokenizer::Tokenizer(const std::string &str, const std::string &_separators) :
text(str), separators(_separators), start(0), ntokens(std::string::npos)
Tokenizer::Tokenizer(std::string str, std::string _separators) :
text(std::move(str)), separators(std::move(_separators)), start(0), ntokens(std::string::npos)
{
// replace known UTF-8 characters with ASCII equivalents
if (utils::has_utf8(text)) text = utils::utf8_subst(text);