As new_part_frames will be assigned with beam.partial_frames when char == "" and new_end_frame wont be used in that case, doing the additional if char == "" is redundant and can be removed. With the removal of the if check, it seemed practical to remove the else block as well and just put the frame_idx + 1 in the assignment else block. This eliminates the need for the new_end_frame local variable and simplifies this block.
As
new_part_frames
will be assigned withbeam.partial_frames
whenchar == ""
andnew_end_frame
wont be used in that case, doing the additionalif char == ""
is redundant and can be removed. With the removal of the if check, it seemed practical to remove the else block as well and just put theframe_idx + 1
in the assignment else block. This eliminates the need for thenew_end_frame
local variable and simplifies this block.