Skip to content

Commit

Permalink
Remove CompiledFunction.id
Browse files Browse the repository at this point in the history
It's unused and we can get rid of the global fn_counter.
  • Loading branch information
tekknolagi committed Dec 29, 2024
1 parent 2af3efd commit 4cbf316
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,14 @@
Env = Dict[str, str]


fn_counter = itertools.count()


@dataclasses.dataclass
class CompiledFunction:
id: int = dataclasses.field(default=0, init=False, compare=False, hash=False)
name: str
params: typing.List[str]
fields: typing.List[str] = dataclasses.field(default_factory=list)
code: typing.List[str] = dataclasses.field(default_factory=list)

def __post_init__(self) -> None:
self.id = next(fn_counter)
self.code.append("HANDLES();")
for param in self.params:
# The parameters are raw pointers and must be updated on GC
Expand Down

0 comments on commit 4cbf316

Please sign in to comment.