mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-16 14:08:35 +08:00
cmVariableWatch: Use the cmDeleteAll algorithm with for_each.
This commit is contained in:
@@ -34,21 +34,16 @@ cmVariableWatch::cmVariableWatch()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<typename C>
|
||||||
|
void deleteAllSecond(typename C::value_type it)
|
||||||
|
{
|
||||||
|
cmDeleteAll(it.second);
|
||||||
|
}
|
||||||
|
|
||||||
cmVariableWatch::~cmVariableWatch()
|
cmVariableWatch::~cmVariableWatch()
|
||||||
{
|
{
|
||||||
cmVariableWatch::StringToVectorOfPairs::iterator svp_it;
|
std::for_each(this->WatchMap.begin(), this->WatchMap.end(),
|
||||||
|
deleteAllSecond<cmVariableWatch::StringToVectorOfPairs>);
|
||||||
for ( svp_it = this->WatchMap.begin();
|
|
||||||
svp_it != this->WatchMap.end(); ++svp_it )
|
|
||||||
{
|
|
||||||
cmVariableWatch::VectorOfPairs::iterator p_it;
|
|
||||||
|
|
||||||
for ( p_it = svp_it->second.begin();
|
|
||||||
p_it != svp_it->second.end(); ++p_it )
|
|
||||||
{
|
|
||||||
delete *p_it;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool cmVariableWatch::AddWatch(const std::string& variable,
|
bool cmVariableWatch::AddWatch(const std::string& variable,
|
||||||
|
Reference in New Issue
Block a user