Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
AngheloAlf committed Jan 19, 2024
1 parent 0a73d37 commit 2fdab04
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/splat/segtypes/common/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,22 +95,16 @@ def _insert_all_auto_sections(
if len(options.opts.auto_all_sections) == 0:
return ret

print()
last_inserted_index = len(ret)

print(f"{len(ret)=}")

# Determine what will be the min insertion index
last_inserted_index = len(ret)
for sect in reversed(self.section_order):
for i, (name, seg) in enumerate(base_segments.items()):
if seg.get_linker_section_linksection() == sect:
continue
last_inserted_index = i

for sect in options.opts.auto_all_sections:
print(sect)
for name, seg in base_segments.items():
print(f" {name}")
if seg.get_linker_section_linksection() == sect:
# Avoid duplicating current section
last_inserted_index = ret.index(seg)
Expand All @@ -124,25 +118,10 @@ def _insert_all_auto_sections(
)
seg.siblings[sect] = sibling
last_inserted_index += 1
current_index = ret.index(seg)
print(f" Current index: {current_index}")
print(
f" Inserting {name} {sect} at index {last_inserted_index}"
)
if last_inserted_index - current_index < 7:
print(f" segments in between: ")
sub_i = current_index
for between in ret[current_index : last_inserted_index + 1]:
print(f" - {sub_i}: {between}")
sub_i += 1
ret.insert(last_inserted_index, sibling)

last_inserted_index = ret.index(sibling)

print(f"{len(ret)=}")

print()

return ret

def parse_subsegments(self, segment_yaml) -> List[Segment]:
Expand Down

0 comments on commit 2fdab04

Please sign in to comment.