From eb12810d3c6def493e6106333056b3892bb5901c Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Fri, 7 Jun 2024 16:49:00 -0700 Subject: [PATCH] [ProfileData] Use DenseMap::lookup (NFC) --- llvm/include/llvm/ProfileData/InstrProf.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/llvm/include/llvm/ProfileData/InstrProf.h b/llvm/include/llvm/ProfileData/InstrProf.h index 15b9eb688e27e..8db10127421aa 100644 --- a/llvm/include/llvm/ProfileData/InstrProf.h +++ b/llvm/include/llvm/ProfileData/InstrProf.h @@ -729,9 +729,7 @@ Function* InstrProfSymtab::getFunction(uint64_t FuncMD5Hash) { } GlobalVariable *InstrProfSymtab::getGlobalVariable(uint64_t MD5Hash) { - if (auto Iter = MD5VTableMap.find(MD5Hash); Iter != MD5VTableMap.end()) - return Iter->second; - return nullptr; + return MD5VTableMap.lookup(MD5Hash); } // To store the sums of profile count values, or the percentage of