Skip to content

Commit

Permalink
fix ensure_id
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Mar 16, 2024
1 parent 11535df commit 00dc1a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions vyper/codegen/ir_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ def __init__(
self.func_ir = None
self.common_ir = None

self._id = self.ensure_id()
self._id = _id # type: ignore[assignment]
self.ensure_id()

assert self.value is not None, "None is not allowed as IRnode value"

Expand Down Expand Up @@ -370,9 +371,8 @@ def generate_id(cls):
return cls._next_id

def ensure_id(self):
if not hasattr(self, "_id"):
if self._id is None:
self._id = self.generate_id()
return self._id

# TODO would be nice to rename to `gas_estimate` or `gas_bound`
@property
Expand Down

0 comments on commit 00dc1a4

Please sign in to comment.