Skip to content
Prev Previous commit
Next Next commit
simplify
  • Loading branch information
iritkatriel committed Jan 28, 2025
commit a5b12bd3b473aa15ecfd4ea66c1423062c9663aa
8 changes: 2 additions & 6 deletions Python/codegen.c
Original file line number Diff line number Diff line change
Expand Up @@ -5306,23 +5306,19 @@ codegen_subscript(compiler *c, expr_ty e)
}
else {
VISIT(c, expr, e->v.Subscript.slice);
int op = 0;
switch (ctx) {
case Load:
ADDOP_I(c, loc, BINARY_OP, NB_SUBSCR);
break;
case Store:
op = STORE_SUBSCR; break;
ADDOP(c, loc, STORE_SUBSCR);
break;
case Del:
op = DELETE_SUBSCR; break;
ADDOP(c, loc, DELETE_SUBSCR);
break;
default:
Py_UNREACHABLE();
}
if (op) {
ADDOP(c, loc, op);
}
}
return SUCCESS;
}
Expand Down