diff --git a/lib/Shine/CLI/Display.py b/lib/Shine/CLI/Display.py index 9f87098..36d258a 100644 --- a/lib/Shine/CLI/Display.py +++ b/lib/Shine/CLI/Display.py @@ -156,17 +156,10 @@ def fieldvals(comp): comps.groupby(key=fieldvals) ] # Sort - def sorter(compgrp): - """ - Sort grplist based on provided sort_key for the first element of - compgrp. - """ - (first, _) = compgrp - if sort_key is None: - return None - return sort_key(first) - - for first, compgrp in sorted(grplst, key=sorter): + if sort_key is not None: + grplst.sort(key=lambda group: sort_key(group[0])) + + for first, compgrp in grplst: # Get component fields fields = _get_fields(first, pat_fields)