[DebugInfo] Use DenseMap::lookup (NFC)
authorKazu Hirata <kazu@google.com>
Tue, 23 Jan 2024 05:19:11 +0000 (21:19 -0800)
committerKazu Hirata <kazu@google.com>
Tue, 23 Jan 2024 05:19:11 +0000 (21:19 -0800)
llvm/lib/DebugInfo/DWARF/DWARFContext.cpp

index e6df590b8dd7a0573af6901b1a8d1d26538cc4b0..792df53d304aa7738f8fa483d2fbc8fe45454257 100644 (file)
@@ -1353,11 +1353,7 @@ DWARFTypeUnit *DWARFContext::getTypeUnitForHash(uint16_t Version, uint64_t Hash,
           DWOUnits.getUnitForIndexEntry(*R));
     return nullptr;
   }
-  const DenseMap<uint64_t, DWARFTypeUnit *> &Map = State->getTypeUnitMap(IsDWO);
-  auto Iter = Map.find(Hash);
-  if (Iter != Map.end())
-    return Iter->second;
-  return nullptr;
+  return State->getTypeUnitMap(IsDWO).lookup(Hash);
 }
 
 DWARFCompileUnit *DWARFContext::getDWOCompileUnitForHash(uint64_t Hash) {