Fix Cppcheck passedByValue warning

This commit is contained in:
Daniel Marjamäki 2019-04-28 07:58:47 +02:00
parent 0e8f2cdf63
commit aaf1af6736
2 changed files with 2 additions and 2 deletions

View File

@ -8493,7 +8493,7 @@ void Tokenizer::eraseDeadCode(Token *begin, const Token *end)
//---------------------------------------------------------------------------
void Tokenizer::syntaxError(const Token *tok, const std::string code) const
void Tokenizer::syntaxError(const Token *tok, const std::string &code) const
{
printDebugOutput(0);
throw InternalError(tok, code.empty() ? "syntax error" : "syntax error: " + code, InternalError::SYNTAX);

View File

@ -597,7 +597,7 @@ private:
public:
/** Syntax error */
void syntaxError(const Token *tok, const std::string code = "") const;
void syntaxError(const Token *tok, const std::string &code = "") const;
/** Syntax error. Unmatched character. */
void unmatchedToken(const Token *tok) const;