Skip to content

Commit 73d9cc6

Browse files
Copilotnunoplopes
andauthored
Remove expr_mapped/type_mapped variables; inline Map calls to preserve short-circuit
Agent-Logs-Url: https://github.com/Cpp2Rust/cpp2rust/sessions/8d9d23ca-3614-485d-bc29-5094aad12e85 Co-authored-by: nunoplopes <2998477+nunoplopes@users.noreply.github.com>
1 parent 77c505e commit 73d9cc6

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

cpp2rust/converter/converter.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3055,11 +3055,9 @@ void Converter::ConvertVarInit(clang::QualType qual_type, clang::Expr *expr) {
30553055
void Converter::ConvertUnsignedArithOperand(clang::Expr *expr,
30563056
clang::QualType type) {
30573057
Convert(expr);
3058-
auto expr_mapped = Mapper::Map(expr->getType()).value_or(std::string{});
3059-
auto type_mapped = Mapper::Map(type).value_or(std::string{});
30603058
if ((expr->isIntegerConstantExpr(ctx_) &&
30613059
!clang::isa<clang::ImplicitCastExpr>(expr)) ||
3062-
expr_mapped != type_mapped) {
3060+
Mapper::Map(expr->getType()) != Mapper::Map(type)) {
30633061
ConvertCast(type);
30643062
}
30653063
}

0 commit comments

Comments
 (0)