浏览代码

Makefiles: Simplify MakeLauncher return value

Bonus NRVO.
Stephen Kelly 9 年之前
父节点
当前提交
ba4ba7c39d
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      Source/cmLocalUnixMakefileGenerator3.cxx

+ 2 - 3
Source/cmLocalUnixMakefileGenerator3.cxx

@@ -1031,6 +1031,7 @@ std::string cmLocalUnixMakefileGenerator3::MakeLauncher(
   cmCustomCommandGenerator const& ccg, cmGeneratorTarget* target,
   cmOutputConverter::RelativeRoot relative)
 {
+  std::string launcher;
   // Short-circuit if there is no launcher.
   const char* prop = "RULE_LAUNCH_CUSTOM";
   const char* val = this->GetRuleLauncher(target, prop);
@@ -1047,14 +1048,12 @@ std::string cmLocalUnixMakefileGenerator3::MakeLauncher(
     }
     vars.Output = output.c_str();
 
-    std::string launcher;
     this->ExpandRuleVariables(launcher, vars);
     if (!launcher.empty()) {
       launcher += " ";
     }
-    return launcher;
   }
-  return "";
+  return launcher;
 }
 
 void cmLocalUnixMakefileGenerator3::AppendCleanCommand(