@@ -304,7 +304,7 @@ static void MutateTxAddOutAddr(CMutableTransaction& tx, const std::string& strIn
304304 CAmount value = ExtractAndValidateValue (vStrInputParts[0 ]);
305305
306306 // extract and validate ADDRESS
307- std::string strAddr = vStrInputParts[1 ];
307+ const std::string& strAddr = vStrInputParts[1 ];
308308 CTxDestination destination = DecodeDestination (strAddr);
309309 if (!IsValidDestination (destination)) {
310310 throw std::runtime_error (" invalid TX output address" );
@@ -337,7 +337,7 @@ static void MutateTxAddOutPubKey(CMutableTransaction& tx, const std::string& str
337337 bool bSegWit = false ;
338338 bool bScriptHash = false ;
339339 if (vStrInputParts.size () == 3 ) {
340- std::string flags = vStrInputParts[2 ];
340+ const std::string& flags = vStrInputParts[2 ];
341341 bSegWit = (flags.find (' W' ) != std::string::npos);
342342 bScriptHash = (flags.find (' S' ) != std::string::npos);
343343 }
@@ -398,7 +398,7 @@ static void MutateTxAddOutMultiSig(CMutableTransaction& tx, const std::string& s
398398 bool bSegWit = false ;
399399 bool bScriptHash = false ;
400400 if (vStrInputParts.size () == numkeys + 4 ) {
401- std::string flags = vStrInputParts.back ();
401+ const std::string& flags = vStrInputParts.back ();
402402 bSegWit = (flags.find (' W' ) != std::string::npos);
403403 bScriptHash = (flags.find (' S' ) != std::string::npos);
404404 }
@@ -473,14 +473,14 @@ static void MutateTxAddOutScript(CMutableTransaction& tx, const std::string& str
473473 CAmount value = ExtractAndValidateValue (vStrInputParts[0 ]);
474474
475475 // extract and validate script
476- std::string strScript = vStrInputParts[1 ];
476+ const std::string& strScript = vStrInputParts[1 ];
477477 CScript scriptPubKey = ParseScript (strScript);
478478
479479 // Extract FLAGS
480480 bool bSegWit = false ;
481481 bool bScriptHash = false ;
482482 if (vStrInputParts.size () == 3 ) {
483- std::string flags = vStrInputParts.back ();
483+ const std::string& flags = vStrInputParts.back ();
484484 bSegWit = (flags.find (' W' ) != std::string::npos);
485485 bScriptHash = (flags.find (' S' ) != std::string::npos);
486486 }
0 commit comments