From 28f9041879620b44505d54670f5ccb2ed48b24d9 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Mon, 22 Jan 2024 21:19:11 -0800 Subject: [PATCH] [DebugInfo] Use DenseMap::lookup (NFC) --- llvm/lib/DebugInfo/DWARF/DWARFContext.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp index e6df590b8dd7..792df53d304a 100644 --- a/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARF/DWARFContext.cpp @@ -1353,11 +1353,7 @@ DWARFTypeUnit *DWARFContext::getTypeUnitForHash(uint16_t Version, uint64_t Hash, DWOUnits.getUnitForIndexEntry(*R)); return nullptr; } - const DenseMap &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) { -- 2.34.1