Skip to content

Commit 8dc2544

Browse files
committed
Change map type
1 parent 9b79557 commit 8dc2544

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

offload/plugins-nextgen/common/include/PluginInterface.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ struct InfoTreeNode {
139139
// * The same key can appear multiple times
140140
std::unique_ptr<llvm::SmallVector<InfoTreeNode, 8>> Children;
141141

142-
std::map<DeviceInfo, size_t> DeviceInfoMap;
142+
llvm::DenseMap<DeviceInfo, size_t> DeviceInfoMap;
143143

144144
InfoTreeNode() : InfoTreeNode("", std::monostate{}, "") {}
145145
InfoTreeNode(std::string Key, VariantType Value, std::string Units)
@@ -187,8 +187,9 @@ struct InfoTreeNode {
187187
}
188188

189189
std::optional<InfoTreeNode *> get(DeviceInfo Info) {
190-
if (DeviceInfoMap.count(Info))
191-
return &(*Children)[DeviceInfoMap[Info]];
190+
auto Result = DeviceInfoMap.find(Info);
191+
if (Result != DeviceInfoMap.end())
192+
return &(*Children)[Result->second];
192193
return std::nullopt;
193194
}
194195

0 commit comments

Comments
 (0)