Skip to content

Commit

Permalink
Fix particletypes topping for 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
nickelpro authored and Pokechu22 committed Feb 17, 2022
1 parent 2868bcb commit cb52b48
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions burger/toppings/particletypes.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from .topping import Topping


class ParticleTypesTopping(Topping):
"""Provides a list of all particle types"""

PROVIDES = [
"particletypes"
]
PROVIDES = ["particletypes"]
DEPENDS = ["identify.particletypes"]

@staticmethod
Expand All @@ -14,10 +13,11 @@ def act(aggregate, classloader, verbose=False):
cf = classloader[aggregate["classes"]["particletypes"]]
# Method is either <clinit> or a void with no parameters, check both
# until we find one that loads constants
for meth in cf.methods.find(args = '', returns = 'V'):
for meth in cf.methods.find(args='', returns='V'):
ops = tuple(meth.code.disassemble())
if(next(x for x in ops if 'ldc' in x.name), False):
if next(filter(lambda op: 'ldc' in op.name, ops), False):
break

for idx, op in enumerate(ops):
if 'ldc' in op.name:
str_val = op.operands[0].string.value
Expand Down

0 comments on commit cb52b48

Please sign in to comment.