From ed4de3c9849f323c735929ad3e32d2450ce303a9 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 1 Sep 2015 13:42:14 -0400 Subject: cmFindProgramCommand: Use Names member instead of passing it --- Source/cmFindProgramCommand.cxx | 17 ++++++++--------- Source/cmFindProgramCommand.h | 6 ++---- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/Source/cmFindProgramCommand.cxx b/Source/cmFindProgramCommand.cxx index fbd9fd3..ef1c16b 100644 --- a/Source/cmFindProgramCommand.cxx +++ b/Source/cmFindProgramCommand.cxx @@ -41,7 +41,7 @@ bool cmFindProgramCommand return true; } - std::string result = FindProgram(this->Names); + std::string result = FindProgram(); if(result != "") { // Save the value in the cache @@ -59,31 +59,30 @@ bool cmFindProgramCommand return true; } -std::string cmFindProgramCommand::FindProgram(std::vector names) +std::string cmFindProgramCommand::FindProgram() { std::string program = ""; if(this->SearchAppBundleFirst || this->SearchAppBundleOnly) { - program = FindAppBundle(names); + program = FindAppBundle(); } if(program.empty() && !this->SearchAppBundleOnly) { - program = cmSystemTools::FindProgram(names, this->SearchPaths, true); + program = cmSystemTools::FindProgram(this->Names, this->SearchPaths, true); } if(program.empty() && this->SearchAppBundleLast) { - program = this->FindAppBundle(names); + program = this->FindAppBundle(); } return program; } -std::string cmFindProgramCommand -::FindAppBundle(std::vector names) +std::string cmFindProgramCommand::FindAppBundle() { - for(std::vector::const_iterator name = names.begin(); - name != names.end() ; ++name) + for(std::vector::const_iterator name = this->Names.begin(); + name != this->Names.end() ; ++name) { std::string appName = *name + std::string(".app"); diff --git a/Source/cmFindProgramCommand.h b/Source/cmFindProgramCommand.h index 70f758f..2881aac 100644 --- a/Source/cmFindProgramCommand.h +++ b/Source/cmFindProgramCommand.h @@ -52,11 +52,9 @@ public: cmTypeMacro(cmFindProgramCommand, cmFindBase); -protected: - std::string FindProgram(std::vector names); - private: - std::string FindAppBundle(std::vector names); + std::string FindProgram(); + std::string FindAppBundle(); std::string GetBundleExecutable(std::string bundlePath); }; -- cgit v0.12