Skip to content
Snippets Groups Projects
Commit 181fab6a authored by Alice Brenon's avatar Alice Brenon
Browse files

Preserve label orders when trimming them

parent 4ed9e1d7
No related branches found
No related tags found
No related merge requests found
...@@ -20,4 +20,4 @@ def trim(labels, maxWidth=10): ...@@ -20,4 +20,4 @@ def trim(labels, maxWidth=10):
else: else:
shards = [label.split(' ') for label in labels] shards = [label.split(' ') for label in labels]
prefixes = [*map(take(maxWidth), shards)] prefixes = [*map(take(maxWidth), shards)]
return [' '.join(prefix) for prefix in sorted(prefixes)] return [' '.join(prefix) for prefix in prefixes]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment