Skip to content

Commit

Permalink
(refactor) use generator expressions instead of lists (kbandla#646)
Browse files Browse the repository at this point in the history
  • Loading branch information
obormot authored Nov 12, 2022
1 parent 54d0b38 commit 97ea45b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dpkt/dpkt.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ def __new__(cls, clsname, clsbases, clsdict):
clsdict['__slots__'] = [x[0] for x in st] + ['data']
t = type.__new__(cls, clsname, clsbases, clsdict)
t.__hdr_fields__ = [x[0] for x in st]
t.__hdr_fmt__ = byte_order + ''.join([x[1] for x in st])
t.__hdr_fmt__ = byte_order + ''.join(x[1] for x in st)
t.__hdr_len__ = struct.calcsize(t.__hdr_fmt__)
t.__hdr_defaults__ = dict(compat_izip(
t.__hdr_fields__, [x[2] for x in st]))
t.__hdr_fields__, (x[2] for x in st)))

# process __bit_fields__
bit_fields = getattr(t, '__bit_fields__', None)
Expand Down

0 comments on commit 97ea45b

Please sign in to comment.