diff options
author | Brad King <brad.king@kitware.com> | 2014-07-14 10:21:24 -0400 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-07-14 10:21:46 -0400 |
commit | 1ca0c0e94ac39c895d5896b0193cbc7b963ff087 (patch) | |
tree | 121c5a343db6b344a24bc93e148bdcef51408636 /Source | |
parent | 102eea60cd636e06ab87bc94a4b326682d7464f1 (diff) | |
download | cmake-1ca0c0e94ac39c895d5896b0193cbc7b963ff087.tar.gz |
cmTarget: Refactor internal imported LinkInterface map
Create the map entry up front and store in it a boolean value indicating
whether the LinkInterface structure has been populated. This approach
leads to shorter code that is easier to follow too.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmTarget.cxx | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 826a44b5f4..79be1db8ff 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -135,7 +135,7 @@ public: LinkInterfaceMapType LinkInterfaceUsageRequirementsOnlyMap; bool PolicyWarnedCMP0022; - typedef std::map<TargetConfigPair, cmTarget::LinkInterface> + typedef std::map<TargetConfigPair, OptionalLinkInterface> ImportLinkInterfaceMapType; ImportLinkInterfaceMapType ImportLinkInterfaceMap; ImportLinkInterfaceMapType ImportLinkInterfaceUsageRequirementsOnlyMap; @@ -5977,26 +5977,21 @@ cmTarget::GetImportLinkInterface(const std::string& config, this->Internal->ImportLinkInterfaceUsageRequirementsOnlyMap : this->Internal->ImportLinkInterfaceMap); - cmTargetInternals::ImportLinkInterfaceMapType::iterator i = lim.find(key); - if(i == lim.end()) + cmTargetInternals::OptionalLinkInterface& iface = lim[key]; + if(!iface.AllDone) { - LinkInterface iface; + iface.AllDone = true; iface.Multiplicity = info->Multiplicity; cmSystemTools::ExpandListArgument(info->Languages, iface.Languages); this->ExpandLinkItems(info->LibrariesProp, info->Libraries, config, headTarget, usage_requirements_only, iface.Libraries); - { std::vector<std::string> deps; cmSystemTools::ExpandListArgument(info->SharedDeps, deps); this->LookupLinkItems(deps, iface.SharedDeps); } - cmTargetInternals::ImportLinkInterfaceMapType::value_type - entry(key, iface); - i = lim.insert(entry).first; - } - return &i->second; + return &iface; } //---------------------------------------------------------------------------- |