wire-gen: simplify if statement

This commit is contained in:
lisa neigut 2019-04-09 19:59:39 -07:00 committed by Rusty Russell
parent 88786b8f7a
commit f2ecf8e9c3

View File

@ -1252,9 +1252,9 @@ for line in fileinput.input(options.files):
if parts == ['']:
continue
is_tlv_msg = len(parts) == 3
if len(parts) == 1 or len(parts) == 2 or is_tlv_msg:
if len(parts) in [1, 2, 3]:
# eg: commit_sig,132,(_tlv)
is_tlv_msg = len(parts) == 3
if len(parts) == 1: # this is a subtype, it has no type number.
subtypes.append(Subtype(parts[0], comments))
else: