Skip to content

Commit

Permalink
MNT: re-use external function in parser loop
Browse files Browse the repository at this point in the history
This code block is already identified above, so rely on it there
rather than reimplementing the same logic twice.
  • Loading branch information
greglucas committed Mar 28, 2024
1 parent 2ef6354 commit 270a322
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions space_packet_parser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,7 @@ def _parse_sequence_container(sc: xtcedef.SequenceContainer):
parsed_items = {}
current_container: xtcedef.SequenceContainer = containers[root_container_name]
while True:
for entry in current_container.entry_list:
if isinstance(entry, xtcedef.Parameter):
_parse_parameter(entry)
elif isinstance(entry, xtcedef.SequenceContainer):
_parse_sequence_container(entry)
_parse_sequence_container(current_container)

valid_inheritors = []
for inheritor_name in current_container.inheritors:
Expand Down

0 comments on commit 270a322

Please sign in to comment.