Skip to content

Commit cc96ce8

Browse files
[CodeGen] Avoid repeated hash lookup (NFC) (#108735)
1 parent b07730b commit cc96ce8

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

clang/lib/CodeGen/CGOpenMPRuntime.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7815,12 +7815,7 @@ class MappableExprsHandler {
78157815
const Expr *VarRef = nullptr, bool ForDeviceAddr = false) {
78167816
if (SkipVarSet.contains(D))
78177817
return;
7818-
auto It = Info.find(D);
7819-
if (It == Info.end())
7820-
It = Info
7821-
.insert(std::make_pair(
7822-
D, SmallVector<SmallVector<MapInfo, 8>, 4>(Total)))
7823-
.first;
7818+
auto It = Info.try_emplace(D, Total).first;
78247819
It->second[Kind].emplace_back(
78257820
L, MapType, MapModifiers, MotionModifiers, ReturnDevicePointer,
78267821
IsImplicit, Mapper, VarRef, ForDeviceAddr);

0 commit comments

Comments
 (0)