File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
offload/plugins-nextgen/common/include Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -139,7 +139,7 @@ struct InfoTreeNode {
139
139
// * The same key can appear multiple times
140
140
std::unique_ptr<llvm::SmallVector<InfoTreeNode, 8 >> Children;
141
141
142
- std::map <DeviceInfo, size_t > DeviceInfoMap;
142
+ llvm::DenseMap <DeviceInfo, size_t > DeviceInfoMap;
143
143
144
144
InfoTreeNode () : InfoTreeNode(" " , std::monostate{}, " " ) {}
145
145
InfoTreeNode (std::string Key, VariantType Value, std::string Units)
@@ -187,8 +187,9 @@ struct InfoTreeNode {
187
187
}
188
188
189
189
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 ];
192
193
return std::nullopt;
193
194
}
194
195
You can’t perform that action at this time.
0 commit comments