From ddfc6db2f5cb3b4852437bc4c60d9eb9faefd658 Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Tue, 20 Mar 2018 06:48:57 +0000 Subject: [PATCH] apibuild: Avoid double sorting of ids MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The uniq() function returns a sorted list, there is no need to sort this list again. Reviewed-by: Daniel P. Berrangé Signed-off-by: Radostin Stoyanov --- docs/apibuild.py | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 1619c8836f..e5e4bc83d2 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -2318,8 +2318,7 @@ class docBuilder: if desc.find("DEPRECATED") != -1: output.write(" \n") - ids = sorted(dict.macros.keys()) - for id in uniq(ids): + for id in uniq(dict.macros.keys()): # Macros are sometime used to masquerade other types. if id in dict.functions: continue @@ -2334,20 +2333,15 @@ class docBuilder: if id in dict.enums: continue output.write(" \n" % (id)) - ids = sorted(dict.enums.keys()) - for id in uniq(ids): + for id in uniq(dict.enums.keys()): output.write(" \n" % (id)) - ids = sorted(dict.typedefs.keys()) - for id in uniq(ids): + for id in uniq(dict.typedefs.keys()): output.write(" \n" % (id)) - ids = sorted(dict.structs.keys()) - for id in uniq(ids): + for id in uniq(dict.structs.keys()): output.write(" \n" % (id)) - ids = sorted(dict.variables.keys()) - for id in uniq(ids): + for id in uniq(dict.variables.keys()): output.write(" \n" % (id)) - ids = sorted(dict.functions.keys()) - for id in uniq(ids): + for id in uniq(dict.functions.keys()): output.write(" \n" % (id)) output.write(" \n") @@ -2363,7 +2357,6 @@ class docBuilder: list(dict.typedefs.keys()) + \ list(dict.structs.keys()) + \ list(dict.enums.keys())) - ids.sort() for id in ids: output.write(" \n" % (id)) output.write(" \n") -- GitLab