Skip to content

Commit 1c198ad

Browse files
committed
refact: do early return
1 parent bc0eba0 commit 1c198ad

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/arch/z80/visitor/function_translator.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ def visit_FUNCTION(self, node):
5555
# if self.O_LEVEL > 1:
5656
# return
5757

58+
if local_var.class_ == CLASS.const or local_var.scope == SCOPE.parameter:
59+
continue
60+
5861
if local_var.class_ == CLASS.array and local_var.scope == SCOPE.local:
5962
bound_ptrs = [] # Bound tables pointers (empty if not used)
6063
lbound_label = local_var.mangled + ".__LBOUND__"
@@ -89,8 +92,7 @@ def visit_FUNCTION(self, node):
8992
if local_var.default_value is not None:
9093
r.extend(self.array_default_value(local_var.type_, local_var.default_value))
9194
self.ic_larrd(local_var.offset, q, local_var.size, r, bound_ptrs) # Initializes array bounds
92-
elif local_var.class_ == CLASS.const or local_var.scope == SCOPE.parameter:
93-
continue
95+
9496
else: # Local vars always defaults to 0, so if 0 we do nothing
9597
if (
9698
local_var.token != "FUNCTION"

0 commit comments

Comments
 (0)