mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-21 14:40:48 +08:00
cmake: Constify GetCommand method.
This commit is contained in:
@@ -226,11 +226,11 @@ bool cmake::CommandExists(const std::string& name) const
|
|||||||
return (this->Commands.find(sName) != this->Commands.end());
|
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;
|
cmCommand* rm = 0;
|
||||||
std::string sName = cmSystemTools::LowerCase(name);
|
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())
|
if (pos != this->Commands.end())
|
||||||
{
|
{
|
||||||
rm = (*pos).second;
|
rm = (*pos).second;
|
||||||
|
@@ -247,7 +247,7 @@ class cmake
|
|||||||
/**
|
/**
|
||||||
* Get a command by its name
|
* Get a command by its name
|
||||||
*/
|
*/
|
||||||
cmCommand *GetCommand(const std::string& name);
|
cmCommand *GetCommand(const std::string& name) const;
|
||||||
|
|
||||||
/** Check if a command exists. */
|
/** Check if a command exists. */
|
||||||
bool CommandExists(const std::string& name) const;
|
bool CommandExists(const std::string& name) const;
|
||||||
|
Reference in New Issue
Block a user