diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-05-16 03:33:30 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-05-17 14:50:18 (GMT) |
commit | f170985e7aaec7562ca481bab49228ece233c4e4 (patch) | |
tree | 41b6cfdc135d8243545faf8e608daca6b51f795e /Source/cmDefinitions.cxx | |
parent | 98c5c90361f89f810cdd6fb233f3e822b638f143 (diff) | |
download | CMake-f170985e7aaec7562ca481bab49228ece233c4e4.zip CMake-f170985e7aaec7562ca481bab49228ece233c4e4.tar.gz CMake-f170985e7aaec7562ca481bab49228ece233c4e4.tar.bz2 |
cmDefinitions: Make the ClosureKeys method static.
For consistency with all other closure-related methods.
Diffstat (limited to 'Source/cmDefinitions.cxx')
-rw-r--r-- | Source/cmDefinitions.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 6fcc002..e2c6876 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -105,18 +105,24 @@ cmDefinitions cmDefinitions::MakeClosure(StackConstIter begin, //---------------------------------------------------------------------------- std::vector<std::string> -cmDefinitions::ClosureKeys(std::set<std::string>& bound) const +cmDefinitions::ClosureKeys(StackConstIter begin, StackConstIter end) { + std::set<std::string> bound; std::vector<std::string> defined; - defined.reserve(this->Map.size()); - for(MapType::const_iterator mi = this->Map.begin(); - mi != this->Map.end(); ++mi) + + for (StackConstIter it = begin; it != end; ++it) { - // Use this key if it is not already set or unset. - if(bound.insert(mi->first).second && mi->second.Exists) + defined.reserve(defined.size() + it->Map.size()); + for(MapType::const_iterator mi = it->Map.begin(); + mi != it->Map.end(); ++mi) { - defined.push_back(mi->first); + // Use this key if it is not already set or unset. + if(bound.insert(mi->first).second && mi->second.Exists) + { + defined.push_back(mi->first); + } } } + return defined; } |