[DivRemPairs] Use DenseMapBase::find instead of operator[]. NFC

This commit is contained in:
Fangrui Song 2020-09-27 01:04:30 -07:00
parent d78c4d9d00
commit 82420b4e49
1 changed files with 3 additions and 3 deletions

View File

@ -151,8 +151,8 @@ static DivRemWorklistTy getWorklist(Function &F) {
// rare than division. // rare than division.
for (auto &RemPair : RemMap) { for (auto &RemPair : RemMap) {
// Find the matching division instruction from the division map. // Find the matching division instruction from the division map.
Instruction *DivInst = DivMap[RemPair.first]; auto It = DivMap.find(RemPair.first);
if (!DivInst) if (It == DivMap.end())
continue; continue;
// We have a matching pair of div/rem instructions. // We have a matching pair of div/rem instructions.
@ -160,7 +160,7 @@ static DivRemWorklistTy getWorklist(Function &F) {
Instruction *RemInst = RemPair.second; Instruction *RemInst = RemPair.second;
// Place it in the worklist. // Place it in the worklist.
Worklist.emplace_back(DivInst, RemInst); Worklist.emplace_back(It->second, RemInst);
} }
return Worklist; return Worklist;