scripts: ctx.py: Only sort children layers if explicitly requested

- Sorting struct fields by name? Eh, that's not a big deal.
- Sorting function params by name? Okay, that's really annoying.

This compromises by sorting only the top-level results by name, and
leaving recursive results in the order returned by collect by default.
Recursive results should usually have a well-defined order.

This should be extendable to the other result scripts as well.
This commit is contained in:
Christopher Haster
2024-11-30 11:35:07 -06:00
parent 3a0a58369a
commit c8a4ee91a6

View File

@@ -923,8 +923,7 @@ def table(Result, results, diff_results=None, *,
for r in results_}
names_ = list(table_.keys())
# sort the children layer
names_.sort()
# only sort the children layer if explicitly requested
if sort:
for k, reverse in reversed(sort):
names_.sort(