Skip to content

Commit 2f71345

Browse files
committed
Simplify condition
1 parent 31aa0f7 commit 2f71345

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

cpp2rust/converter/converter.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2466,17 +2466,13 @@ void Converter::ConvertMemberExpr(clang::MemberExpr *expr) {
24662466
auto *base = expr->getBase();
24672467
bool base_is_this = clang::isa<clang::CXXThisExpr>(base->IgnoreCasts());
24682468
PushExprKind push(*this, isLValue() ? ExprKind::LValue : ExprKind::RValue);
2469-
auto *method = clang::dyn_cast<clang::CXXMethodDecl>(member);
2470-
PushExplicitAutoref autoref(*this, method && !method->isStatic() &&
2471-
isCallee() && !base_is_this
2472-
? std::optional{!method->isConst()}
2473-
: autoref_mut_);
24742469
if (expr->isArrow() && !base_is_this) {
24752470
ConvertArrow(base);
24762471
} else {
24772472
Convert(base);
24782473
}
24792474

2475+
auto *method = clang::dyn_cast<clang::CXXMethodDecl>(member);
24802476
if (method && IsOverloadedMethod(method)) {
24812477
StrCat(token::kDot);
24822478
StrCat(GetOverloadedFunctionName(method));

0 commit comments

Comments
 (0)