diff options
author | Tushar Maheshwari <tushar27192@gmail.com> | 2020-05-13 14:24:03 (GMT) |
---|---|---|
committer | Tushar Maheshwari <tushar27192@gmail.com> | 2020-05-15 13:28:02 (GMT) |
commit | 6728f0fa858c1782e6c619661f32c016d84d1ad6 (patch) | |
tree | 5debb1b915705c9cbe1ca397304a76233c9847cb /Source/cmState.cxx | |
parent | 1cc4bc41916b60e9d52c3a89f6f77b091fbe0d31 (diff) | |
download | CMake-6728f0fa858c1782e6c619661f32c016d84d1ad6.zip CMake-6728f0fa858c1782e6c619661f32c016d84d1ad6.tar.gz CMake-6728f0fa858c1782e6c619661f32c016d84d1ad6.tar.bz2 |
cmPropertyDefinitionMap: simplify and shorten
Diffstat (limited to 'Source/cmState.cxx')
-rw-r--r-- | Source/cmState.cxx | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/Source/cmState.cxx b/Source/cmState.cxx index df013f4..18d8537 100644 --- a/Source/cmState.cxx +++ b/Source/cmState.cxx @@ -265,7 +265,7 @@ void cmState::RemoveCacheEntryProperty(std::string const& key, cmStateSnapshot cmState::Reset() { this->GlobalProperties.Clear(); - this->PropertyDefinitions.clear(); + this->PropertyDefinitions = {}; this->GlobVerificationManager->Reset(); cmStateDetail::PositionType pos = this->SnapshotData.Truncate(); @@ -331,39 +331,23 @@ void cmState::DefineProperty(const std::string& name, const std::string& ShortDescription, const std::string& FullDescription, bool chained) { - this->PropertyDefinitions[scope].DefineProperty( - name, scope, ShortDescription, FullDescription, chained); + this->PropertyDefinitions.DefineProperty(name, scope, ShortDescription, + FullDescription, chained); } cmPropertyDefinition const* cmState::GetPropertyDefinition( const std::string& name, cmProperty::ScopeType scope) const { - if (this->IsPropertyDefined(name, scope)) { - cmPropertyDefinitionMap const& defs = - this->PropertyDefinitions.find(scope)->second; - return &defs.find(name)->second; - } - return nullptr; -} - -bool cmState::IsPropertyDefined(const std::string& name, - cmProperty::ScopeType scope) const -{ - auto it = this->PropertyDefinitions.find(scope); - if (it == this->PropertyDefinitions.end()) { - return false; - } - return it->second.IsPropertyDefined(name); + return this->PropertyDefinitions.GetPropertyDefinition(name, scope); } bool cmState::IsPropertyChained(const std::string& name, cmProperty::ScopeType scope) const { - auto it = this->PropertyDefinitions.find(scope); - if (it == this->PropertyDefinitions.end()) { - return false; + if (auto def = this->GetPropertyDefinition(name, scope)) { + return def->IsChained(); } - return it->second.IsPropertyChained(name); + return false; } void cmState::SetLanguageEnabled(std::string const& l) |