Skip to content

Commit bf37d73

Browse files
committed
Clean up
1 parent a5b93e3 commit bf37d73

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

mypyc/codegen/emitfunc.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@
8989
RStruct,
9090
RTuple,
9191
RType,
92-
is_bit_rprimitive,
93-
is_bool_rprimitive,
92+
is_bool_or_bit_rprimitive,
9493
is_int32_rprimitive,
9594
is_int64_rprimitive,
9695
is_int_rprimitive,
@@ -634,11 +633,7 @@ def emit_method_call(self, dest: str, op_obj: Value, name: str, op_args: list[Va
634633
def visit_inc_ref(self, op: IncRef) -> None:
635634
if (
636635
isinstance(op.src, Box)
637-
and (
638-
is_none_rprimitive(op.src.src.type)
639-
or is_bool_rprimitive(op.src.src.type)
640-
or is_bit_rprimitive(op.src.src.type)
641-
)
636+
and (is_none_rprimitive(op.src.src.type) or is_bool_or_bit_rprimitive(op.src.src.type))
642637
and HAVE_IMMORTAL
643638
):
644639
# On Python 3.12+, None/True/False are immortal, and we can skip inc ref

mypyc/irbuild/ll_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1701,8 +1701,8 @@ def unary_not(self, value: Value, line: int, *, likely_bool: bool = False) -> Va
17011701
self.add(Assign(res, self.true()))
17021702
self.goto(out)
17031703
self.activate_block(other)
1704-
y = self._non_specialized_unary_op(value, "not", line)
1705-
self.add(Assign(res, y))
1704+
val = self._non_specialized_unary_op(value, "not", line)
1705+
self.add(Assign(res, val))
17061706
self.goto(out)
17071707
self.activate_block(out)
17081708
return res

0 commit comments

Comments
 (0)