From c8a4ee91a62dc2d49bc83e170f643b6a8a9d7e3f Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sat, 30 Nov 2024 11:35:07 -0600 Subject: [PATCH] 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. --- scripts/ctx.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/ctx.py b/scripts/ctx.py index 47409a07..6becb4fe 100755 --- a/scripts/ctx.py +++ b/scripts/ctx.py @@ -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(