File tree Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Expand file tree Collapse file tree 1 file changed +9
-17
lines changed Original file line number Diff line number Diff line change @@ -1247,24 +1247,16 @@ def process_partition(self, partition_index):
1247
1247
else :
1248
1248
format_fields .append (field )
1249
1249
1250
- # We need to determine LAA before LPL
1251
- try :
1252
- laa_index = next (
1253
- index
1254
- for index , format_field in enumerate (format_fields )
1255
- if format_field .name == "LAA"
1256
- )
1257
- lpl_index = next (
1258
- index
1259
- for index , format_field in enumerate (format_fields )
1260
- if format_field .name == "LPL"
1261
- )
1262
-
1250
+ format_field_names = [format_field .name for format_field in format_fields ]
1251
+ if "LAA" in format_field_names and "LPL" in format_field_names :
1252
+ laa_index = format_field_names .index ("LAA" )
1253
+ lpl_index = format_field_names .index ("LPL" )
1254
+ # LAA needs to come before LPL
1263
1255
if lpl_index < laa_index :
1264
- format_fields . insert ( laa_index + 1 , format_fields [lpl_index ])
1265
- format_fields . pop ( lpl_index )
1266
- except StopIteration :
1267
- pass
1256
+ format_fields [ laa_index ] , format_fields [lpl_index ] = (
1257
+ format_fields [ lpl_index ],
1258
+ format_fields [ laa_index ],
1259
+ )
1268
1260
1269
1261
last_position = None
1270
1262
with IcfPartitionWriter (
You can’t perform that action at this time.
0 commit comments