From ba4ba7c39de82b805652efbb7dc5e1659c53f36b Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 27 Aug 2016 13:44:54 +0200 Subject: [PATCH] Makefiles: Simplify MakeLauncher return value Bonus NRVO. --- Source/cmLocalUnixMakefileGenerator3.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 47b891f30..53c2ff6f8 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/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(