Browse Source

cmMacroCommand: Declare arg in the scope that it is used.

It can make sense to declare objects outside of loops if
the size required by the object can grow (eg std::string when
using getline), but that is not the case here.
Stephen Kelly 10 years ago
parent
commit
2c4a7298fc
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Source/cmMacroCommand.cxx

+ 2 - 1
Source/cmMacroCommand.cxx

@@ -85,7 +85,6 @@ bool cmMacroHelperCommand::InvokeInitialPass
   this->Makefile->ExpandArguments(args, expandedArgs);
 
   std::string tmps;
-  cmListFileArgument arg;
 
   // make sure the number of arguments passed is at least the number
   // required by the signature
@@ -144,6 +143,8 @@ bool cmMacroHelperCommand::InvokeInitialPass
       // Set the FilePath on the arguments to match the function since it is
       // not stored and the original values may be freed
       k->FilePath = this->FilePath.c_str();
+
+      cmListFileArgument arg;
       if(k->Delim == cmListFileArgument::Bracket)
         {
         arg.Value = k->Value;