From a7af2c99e30ed9366d5ca6252ec277d5b3d79e56 Mon Sep 17 00:00:00 2001 From: Nick Wellnhofer Date: Thu, 18 Aug 2022 20:03:07 +0200 Subject: [PATCH] Fix order of exports in libxml2-api.xml The values passed to the `uniq` function are dictionary keys and should already be unique. On older Python versions, this would reshuffle the list after it had just been sorted. --- doc/apibuild.py | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/doc/apibuild.py b/doc/apibuild.py index fb0e733a..f46e1063 100755 --- a/doc/apibuild.py +++ b/doc/apibuild.py @@ -83,12 +83,6 @@ def escape(raw): raw = raw.replace('"', '"') return raw -def uniq(items): - d = {} - for item in items: - d[item]=1 - return list(d.keys()) - class identifier: def __init__(self, name, header=None, module=None, type=None, lineno = 0, info=None, extra=None, conditionals = None): @@ -1807,7 +1801,7 @@ class docBuilder: ids = list(dict.macros.keys()) ids.sort() - for id in uniq(ids): + for id in ids: # Macros are sometime used to masquerade other types. if id in dict.functions: continue @@ -1822,23 +1816,23 @@ class docBuilder: output.write(" \n" % (id)) ids = list(dict.enums.keys()) ids.sort() - for id in uniq(ids): + for id in ids: output.write(" \n" % (id)) ids = list(dict.typedefs.keys()) ids.sort() - for id in uniq(ids): + for id in ids: output.write(" \n" % (id)) ids = list(dict.structs.keys()) ids.sort() - for id in uniq(ids): + for id in ids: output.write(" \n" % (id)) ids = list(dict.variables.keys()) ids.sort() - for id in uniq(ids): + for id in ids: output.write(" \n" % (id)) ids = list(dict.functions.keys()) ids.sort() - for id in uniq(ids): + for id in ids: output.write(" \n" % (id)) output.write(" \n")