Fix section ordering with many same-named sections

Before, this was comparing, for example, `.text-2`
with `.text-10` with standard string comparison,
yielding `.text-10` before `.text-2`.

Instead, this simply uses a stable sort by name,
which preserves the relative ordering of sections.
This commit is contained in:
2025-03-10 21:51:54 -06:00
parent ffb38d1bb0
commit 5898d7aebf
4 changed files with 227 additions and 2 deletions

View File

@@ -701,7 +701,7 @@ pub fn display_sections(
});
}
}
sections.sort_by(|a, b| a.id.cmp(&b.id));
sections.sort_by(|a, b| a.name.cmp(&b.name));
sections
}