فهرست منبع

Merge topic 'local-var'

4d71bea02c cmLocalGenerator::AddConfigVariableFlags: optimize string construction

Acked-by: Kitware Robot <[email protected]>
Merge-request: !3793
Brad King 6 سال پیش
والد
کامیت
c2ead49451
1فایلهای تغییر یافته به همراه3 افزوده شده و 4 حذف شده
  1. 3 4
      Source/cmLocalGenerator.cxx

+ 3 - 4
Source/cmLocalGenerator.cxx

@@ -2096,12 +2096,11 @@ void cmLocalGenerator::AddConfigVariableFlags(std::string& flags,
                                               const std::string& config)
 {
   // Add the flags from the variable itself.
-  std::string flagsVar = var;
-  this->AppendFlags(flags, this->Makefile->GetSafeDefinition(flagsVar));
+  this->AppendFlags(flags, this->Makefile->GetSafeDefinition(var));
   // Add the flags from the build-type specific variable.
   if (!config.empty()) {
-    flagsVar += "_";
-    flagsVar += cmSystemTools::UpperCase(config);
+    const std::string flagsVar =
+      cmStrCat(var, '_', cmSystemTools::UpperCase(config));
     this->AppendFlags(flags, this->Makefile->GetSafeDefinition(flagsVar));
   }
 }