From b1fb83ab538f6690822c16e5d08264278cb5942b Mon Sep 17 00:00:00 2001 From: Brett Smith Date: Sat, 26 Aug 2023 21:55:39 -0400 Subject: [PATCH] 20839: Optimize list sort Trivial optimization I noticed while working around here. Arvados-DCO-1.1-Signed-off-by: Brett Smith --- sdk/python/arvados/commands/federation_migrate.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/python/arvados/commands/federation_migrate.py b/sdk/python/arvados/commands/federation_migrate.py index 32b3211f14..3090ff8f9a 100755 --- a/sdk/python/arvados/commands/federation_migrate.py +++ b/sdk/python/arvados/commands/federation_migrate.py @@ -111,7 +111,7 @@ def fetch_users(clusters, loginCluster): # call add_accum_rows() to generate the report rows with # the "home cluster" set, and also fill in the by_email table. - users = sorted(users, key=lambda u: u["email"]+"::"+(u["username"] or "")+"::"+u["uuid"]) + users.sort(key=lambda u: (u["email"], u["username"] or "", u["uuid"])) accum = [] lastemail = None -- 2.30.2