[clang] [clang] [NFC] explicitly check if ParentMap contains key (PR #121736)
Jay Foad via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 6 01:02:10 PST 2025
================
@@ -78,7 +78,7 @@ static void BuildParentMap(MapTy& M, Stmt* S,
// The right thing to do is to give the OpaqueValueExpr its syntactic
// parent, then not reassign that when traversing the semantic expressions.
OpaqueValueExpr *OVE = cast<OpaqueValueExpr>(S);
- if (OVMode == OV_Transparent || !M[OVE->getSourceExpr()]) {
+ if (OVMode == OV_Transparent || !M.contains(OVE->getSourceExpr())) {
M[OVE->getSourceExpr()] = S;
----------------
jayfoad wrote:
Could use `M.find` to avoid the duplicated lookup here?
https://github.com/llvm/llvm-project/pull/121736
More information about the cfe-commits
mailing list