From 275185ac2b30b655b53100a129f5d7518ed943ad Mon Sep 17 00:00:00 2001 From: Stephen Kelly Date: Sat, 11 Apr 2015 12:44:18 +0200 Subject: [PATCH] cmake: Constify GetCommand method. --- Source/cmake.cxx | 4 ++-- Source/cmake.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index 8868ef64b..b27fefa8d 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -226,11 +226,11 @@ bool cmake::CommandExists(const std::string& name) const return (this->Commands.find(sName) != this->Commands.end()); } -cmCommand *cmake::GetCommand(const std::string& name) +cmCommand *cmake::GetCommand(const std::string& name) const { cmCommand* rm = 0; std::string sName = cmSystemTools::LowerCase(name); - RegisteredCommandsMap::iterator pos = this->Commands.find(sName); + RegisteredCommandsMap::const_iterator pos = this->Commands.find(sName); if (pos != this->Commands.end()) { rm = (*pos).second; diff --git a/Source/cmake.h b/Source/cmake.h index a9f791d74..c436c7773 100644 --- a/Source/cmake.h +++ b/Source/cmake.h @@ -247,7 +247,7 @@ class cmake /** * Get a command by its name */ - cmCommand *GetCommand(const std::string& name); + cmCommand *GetCommand(const std::string& name) const; /** Check if a command exists. */ bool CommandExists(const std::string& name) const;