Skip to content

Commit ed49167

Browse files
committed
Refactor if statement.
1 parent e7f2d56 commit ed49167

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

Python/codegen.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3962,26 +3962,26 @@ maybe_optimize_function_call(compiler *c, expr_ty e, jump_target_label end)
39623962

39633963
expr_ty arg_expr = asdl_seq_GET(args, 0);
39643964

3965-
if (arg_expr->kind != GeneratorExp_kind) {
3966-
if (_PyUnicode_EqualToASCIIString(func->v.Name.id, "frozenset")
3967-
&& (arg_expr->kind == Set_kind || arg_expr->kind == SetComp_kind)) {
3968-
NEW_JUMP_TARGET_LABEL(c, skip_optimization);
3965+
if (_PyUnicode_EqualToASCIIString(func->v.Name.id, "frozenset")
3966+
&& (arg_expr->kind == Set_kind || arg_expr->kind == SetComp_kind)) {
3967+
NEW_JUMP_TARGET_LABEL(c, skip_optimization);
39693968

3970-
ADDOP_I(c, loc, COPY, 1);
3971-
ADDOP_I(c, loc, LOAD_COMMON_CONSTANT, CONSTANT_BUILTIN_FROZENSET);
3972-
ADDOP_COMPARE(c, loc, Is);
3973-
ADDOP_JUMP(c, loc, POP_JUMP_IF_FALSE, skip_optimization);
3974-
ADDOP(c, loc, POP_TOP);
3969+
ADDOP_I(c, loc, COPY, 1);
3970+
ADDOP_I(c, loc, LOAD_COMMON_CONSTANT, CONSTANT_BUILTIN_FROZENSET);
3971+
ADDOP_COMPARE(c, loc, Is);
3972+
ADDOP_JUMP(c, loc, POP_JUMP_IF_FALSE, skip_optimization);
3973+
ADDOP(c, loc, POP_TOP);
39753974

3976-
VISIT(c, expr, arg_expr);
3977-
ADDOP_I(c, loc, CALL_INTRINSIC_1, INTRINSIC_BUILD_FROZENSET);
3975+
VISIT(c, expr, arg_expr);
3976+
ADDOP_I(c, loc, CALL_INTRINSIC_1, INTRINSIC_BUILD_FROZENSET);
39783977

3979-
ADDOP_JUMP(c, loc, JUMP, end);
3978+
ADDOP_JUMP(c, loc, JUMP, end);
39803979

3981-
USE_LABEL(c, skip_optimization);
3982-
return 1;
3983-
}
3980+
USE_LABEL(c, skip_optimization);
3981+
return 1;
3982+
}
39843983

3984+
if (arg_expr->kind != GeneratorExp_kind) {
39853985
return 0;
39863986
}
39873987

0 commit comments

Comments
 (0)