diff options
author | Stephen Kelly <steveire@gmail.com> | 2015-04-26 13:38:36 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2015-04-29 22:32:18 (GMT) |
commit | 5ccff6408c93e67d7f8445ce1bf6465b068d6f6b (patch) | |
tree | 4f1b66350da2c061872dd17713e26c856eb45a7c /Source/cmDefinitions.cxx | |
parent | f79cd99d6dcdfcdcd341c5ea90a5f2d9c4d6d3bc (diff) | |
download | CMake-5ccff6408c93e67d7f8445ce1bf6465b068d6f6b.zip CMake-5ccff6408c93e67d7f8445ce1bf6465b068d6f6b.tar.gz CMake-5ccff6408c93e67d7f8445ce1bf6465b068d6f6b.tar.bz2 |
cmDefinitions: Externalize looping for ClosureKeys.
Diffstat (limited to 'Source/cmDefinitions.cxx')
-rw-r--r-- | Source/cmDefinitions.cxx | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/Source/cmDefinitions.cxx b/Source/cmDefinitions.cxx index 718d9ec..115e30a 100644 --- a/Source/cmDefinitions.cxx +++ b/Source/cmDefinitions.cxx @@ -116,26 +116,19 @@ cmDefinitions::MakeClosure(std::set<std::string>& undefined, } //---------------------------------------------------------------------------- -std::vector<std::string> cmDefinitions::ClosureKeys() const +std::vector<std::string> +cmDefinitions::ClosureKeys(std::set<std::string>& bound) const { std::vector<std::string> defined; - std::set<std::string> bound; - - cmDefinitions const* up = this; - - while (up) + defined.reserve(this->Map.size()); + for(MapType::const_iterator mi = this->Map.begin(); + mi != this->Map.end(); ++mi) { - // Consider local definitions. - for(MapType::const_iterator mi = up->Map.begin(); - mi != up->Map.end(); ++mi) + // Use this key if it is not already set or unset. + if(bound.insert(mi->first).second && mi->second.Exists) { - // 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); - } + defined.push_back(mi->first); } - up = up->Up; } return defined; } |