From c768e398f9c29aa12680fe89a52ce9b00eff2866 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Wed, 15 Jan 2014 23:56:38 +0100 Subject: cmMakefile: make some methods take const std::string& instead of const char* Most callers already have a std::string, on which they called c_str() to pass it into these methods, which internally converted it back to std::string. Pass a std::string directly to these methods now, avoiding all these conversions. Those methods that only pass in a const char* will get the conversion to std::string now only once. --- Source/cmAddDependenciesCommand.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Source/cmAddDependenciesCommand.cxx') diff --git a/Source/cmAddDependenciesCommand.cxx b/Source/cmAddDependenciesCommand.cxx index a7ffded2bc..b55334f859 100644 --- a/Source/cmAddDependenciesCommand.cxx +++ b/Source/cmAddDependenciesCommand.cxx @@ -24,14 +24,14 @@ bool cmAddDependenciesCommand } std::string target_name = args[0]; - if(this->Makefile->IsAlias(target_name.c_str())) + if(this->Makefile->IsAlias(target_name)) { cmOStringStream e; e << "Cannot add target-level dependencies to alias target \"" << target_name << "\".\n"; this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); } - if(cmTarget* target = this->Makefile->FindTargetToUse(target_name.c_str())) + if(cmTarget* target = this->Makefile->FindTargetToUse(target_name)) { if (target->GetType() == cmTarget::INTERFACE_LIBRARY) { -- cgit v1.2.1