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 {
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
You can’t perform that action at this time.
0 commit comments