whitepaper: 352/169 — wave4 MEDIUM (hadoop/hbase/nova/neutron/openstack) + fix odl-0002 dup

This commit is contained in:
russell@unturf.com 2026-03-27 15:33:17 -04:00
parent 9934133dcf
commit 835ae73b0f
82 changed files with 5931 additions and 6 deletions

View file

@ -0,0 +1,30 @@
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index abc1234..def5678 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -456,14 +456,19 @@ std::vector<BT<std::string>>
cmComputeLinkInformation::GetDirectoriesWithBacktraces()
{
std::vector<BT<std::string>> directoriesWithBacktraces;
std::vector<BT<std::string>> targetLinkDirectories =
this->Target->GetLinkDirectories(this->Config, this->LinkLanguage);
+ // Build an index from directory string → BT entry for O(1) lookup.
+ std::unordered_map<std::string, BT<std::string>> dirIndex;
+ dirIndex.reserve(targetLinkDirectories.size());
+ for (auto& bt : targetLinkDirectories)
+ dirIndex.emplace(bt.Value, std::move(bt));
+
std::vector<std::string> const& orderedDirectories = this->GetDirectories();
for (std::string const& dir : orderedDirectories) {
- auto result = std::find(targetLinkDirectories.begin(),
- targetLinkDirectories.end(), dir);
- if (result != targetLinkDirectories.end()) {
- directoriesWithBacktraces.emplace_back(std::move(*result));
+ auto result = dirIndex.find(dir);
+ if (result != dirIndex.end()) {
+ directoriesWithBacktraces.emplace_back(std::move(result->second));
} else {
directoriesWithBacktraces.emplace_back(dir);
}