diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml index 4c4ff8a1df..2eb0113487 100644 --- a/.github/workflows/pull-request.yaml +++ b/.github/workflows/pull-request.yaml @@ -24,6 +24,7 @@ jobs: with: types: | feat + perf fix chore refactor diff --git a/vyper/utils.py b/vyper/utils.py index 2b95485f4e..f4f14a346e 100644 --- a/vyper/utils.py +++ b/vyper/utils.py @@ -36,6 +36,9 @@ def __repr__(self): def __iter__(self): return iter(self._data) + def __reversed__(self): + return reversed(self._data) + def __contains__(self, item): return self._data.__contains__(item) @@ -45,6 +48,9 @@ def __len__(self): def first(self): return next(iter(self)) + def last(self): + return next(reversed(self)) + def pop(self): return self._data.popitem()[0] diff --git a/vyper/venom/venom_to_assembly.py b/vyper/venom/venom_to_assembly.py index c087d29bff..eb8c4e69ec 100644 --- a/vyper/venom/venom_to_assembly.py +++ b/vyper/venom/venom_to_assembly.py @@ -530,8 +530,7 @@ def _generate_evm_for_instruction( else: # peek at next_liveness to find the next scheduled item, # and optimistically swap with it - # TODO: implement OrderedSet.last() - next_scheduled = list(next_liveness)[-1] + next_scheduled = next_liveness.last() self.swap_op(assembly, stack, next_scheduled) return apply_line_numbers(inst, assembly)