@@ -400,7 +400,7 @@ SimpleDebugger::cmd_help(std::vector<std::string>& tokens)
400400 }
401401
402402 if ( tokens.size () > 1 ) {
403- std::string c = tokens[1 ];
403+ const std::string& c = tokens[1 ];
404404 if ( cmdHelp.find (c) != cmdHelp.end () ) {
405405 std::cout << c << " " << cmdHelp.at (c) << std::endl;
406406 }
@@ -559,8 +559,8 @@ SimpleDebugger::cmd_print(std::vector<std::string>& tokens)
559559 }
560560
561561 // See if have a -r or not
562- int recurse = 0 ;
563- std::string tok = tokens[1 ];
562+ int recurse = 0 ;
563+ const std::string& tok = tokens[1 ];
564564 if ( tok.size () >= 2 && tok[0 ] == ' -' && tok[1 ] == ' r' ) {
565565 // Got a -r
566566 std::string num = tok.substr (2 );
@@ -744,7 +744,7 @@ SimpleDebugger::cmd_setHandler(std::vector<std::string>& tokens)
744744 size_t tindex = 2 ;
745745 unsigned handler = 0 ;
746746 while ( tindex < tokens.size () ) {
747- std::string type = tokens[tindex++];
747+ const std::string& type = tokens[tindex++];
748748 // printf("%s ", type.c_str());
749749
750750 if ( type == " bc" )
@@ -802,7 +802,7 @@ SimpleDebugger::cmd_addTraceVar(std::vector<std::string>& tokens)
802802 // Get trace vars and add associated objectBuffers
803803 size_t tindex = 2 ;
804804 while ( tindex < tokens.size () ) {
805- std::string tvar = tokens[tindex++];
805+ const std::string& tvar = tokens[tindex++];
806806 // printf("%s ", tvar.c_str());
807807
808808 // Find and check trace variable
@@ -1070,12 +1070,12 @@ Core::Serialization::ObjectMapComparison*
10701070parseComparison (std::vector<std::string>& tokens, size_t & index, Core::Serialization::ObjectMap* obj, std::string& name)
10711071{
10721072 // Get first comparison
1073- std::string var = tokens[index++];
1073+ const std::string& var = tokens[index++];
10741074 if ( index >= tokens.size () ) {
10751075 printf (" Invalid format for trigger test\n " );
10761076 return nullptr ;
10771077 }
1078- std::string opstr = tokens[index++];
1078+ const std::string& opstr = tokens[index++];
10791079 Core::Serialization::ObjectMapComparison::Op op =
10801080 Core::Serialization::ObjectMapComparison::getOperationFromString (opstr);
10811081
@@ -1165,7 +1165,7 @@ parseComparison(std::vector<std::string>& tokens, size_t& index, Core::Serializa
11651165WatchPoint::WPAction*
11661166parseAction (std::vector<std::string>& tokens, size_t & index, Core::Serialization::ObjectMap* obj)
11671167{
1168- std::string action = tokens[index++];
1168+ const std::string& action = tokens[index++];
11691169
11701170 if ( action == " interactive" ) {
11711171 return new WatchPoint::InteractiveWPAction ();
@@ -1188,14 +1188,14 @@ parseAction(std::vector<std::string>& tokens, size_t& index, Core::Serialization
11881188 printf (" Missing variable for set command\n " );
11891189 return nullptr ;
11901190 }
1191- std::string tvar = tokens[index++];
1191+ const std::string& tvar = tokens[index++];
11921192 // printf("%s ", tvar.c_str());
11931193
11941194 if ( index >= tokens.size () ) {
11951195 printf (" Missing value for set command\n " );
11961196 return nullptr ;
11971197 }
1198- std::string tval = tokens[index++];
1198+ const std::string& tval = tokens[index++];
11991199
12001200 // Find and check variable
12011201 Core::Serialization::ObjectMap* map = obj->findVariable (tvar);
0 commit comments