Browse Source

cmMacroCommand: Declare tmps in the scope that it's used.

We don't particularly need to reuse the string memory here, and this
pattern is not common in CMake.
Stephen Kelly 10 years ago
parent
commit
6774c92b58
1 changed files with 1 additions and 3 deletions
  1. 1 3
      Source/cmMacroCommand.cxx

+ 1 - 3
Source/cmMacroCommand.cxx

@@ -84,8 +84,6 @@ bool cmMacroHelperCommand::InvokeInitialPass
   std::vector<std::string> expandedArgs;
   std::vector<std::string> expandedArgs;
   this->Makefile->ExpandArguments(args, expandedArgs);
   this->Makefile->ExpandArguments(args, expandedArgs);
 
 
-  std::string tmps;
-
   // make sure the number of arguments passed is at least the number
   // make sure the number of arguments passed is at least the number
   // required by the signature
   // required by the signature
   if (expandedArgs.size() < this->Args.size() - 1)
   if (expandedArgs.size() < this->Args.size() - 1)
@@ -151,7 +149,7 @@ bool cmMacroHelperCommand::InvokeInitialPass
         }
         }
       else
       else
         {
         {
-        tmps = k->Value;
+        std::string tmps = k->Value;
         // replace formal arguments
         // replace formal arguments
         for (unsigned int j = 0; j < variables.size(); ++j)
         for (unsigned int j = 0; j < variables.size(); ++j)
           {
           {