@@ -1680,8 +1680,8 @@ namespace simplecpp {
16801680 };
16811681 private:
16821682 /* * Create new token where Token::macro is set for replaced tokens */
1683- Token *newMacroToken (const TokenString & str, const Location &loc, bool replaced, const Token *expandedFromToken=nullptr ) const {
1684- Token *tok = new Token (str,loc);
1683+ Token *newMacroToken (TokenString str, const Location &loc, bool replaced, const Token *expandedFromToken=nullptr ) const {
1684+ Token *tok = new Token (std::move ( str) ,loc);
16851685 if (replaced)
16861686 tok->macro = nameTokDef->str ();
16871687 if (expandedFromToken)
@@ -2300,7 +2300,7 @@ namespace simplecpp {
23002300 output->takeTokens (tokensB);
23012301 } else if (sameline (B, nextTok) && sameline (B, nextTok->next ) && nextTok->op == ' #' && nextTok->next ->op == ' #' ) {
23022302 TokenList output2 (files);
2303- output2.push_back (new Token (strAB, tok->location ));
2303+ output2.push_back (new Token (std::move ( strAB) , tok->location ));
23042304 nextTok = expandHashHash (&output2, loc, nextTok, macros, expandedmacros, parametertokens);
23052305 output->deleteToken (A);
23062306 output->takeTokens (output2);
@@ -3455,7 +3455,7 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
34553455 hdr += tok->str ();
34563456 }
34573457 inc2.clear ();
3458- inc2.push_back (new Token (hdr, inc1.cfront ()->location ));
3458+ inc2.push_back (new Token (std::move ( hdr) , inc1.cfront ()->location ));
34593459 inc2.front ()->op = ' <' ;
34603460 }
34613461
@@ -3615,7 +3615,7 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
36153615 E += (E.empty () ? " " : " " ) + tok->str ();
36163616 const long long result = evaluate (expr, dui, sizeOfType);
36173617 conditionIsTrue = (result != 0 );
3618- ifCond->push_back (IfCond (rawtok->location , E , result));
3618+ ifCond->push_back (IfCond (rawtok->location , std::move (E) , result));
36193619 } else {
36203620 const long long result = evaluate (expr, dui, sizeOfType);
36213621 conditionIsTrue = (result != 0 );
@@ -3711,7 +3711,7 @@ void simplecpp::preprocess(simplecpp::TokenList &output, const simplecpp::TokenL
37113711 else if (output.back ())
37123712 output.back ()->setstr (output.cback ()->str () + s);
37133713 else
3714- output.push_back (new Token (s , loc));
3714+ output.push_back (new Token (std::move (s) , loc));
37153715 } else {
37163716 output.takeTokens (tokens);
37173717 }
0 commit comments