Skip to content

Commit a7af2c9

Browse files
committed
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.
1 parent f82b56c commit a7af2c9

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

doc/apibuild.py

+6-12
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,6 @@ def escape(raw):
8383
raw = raw.replace('"', '"')
8484
return raw
8585

86-
def uniq(items):
87-
d = {}
88-
for item in items:
89-
d[item]=1
90-
return list(d.keys())
91-
9286
class identifier:
9387
def __init__(self, name, header=None, module=None, type=None, lineno = 0,
9488
info=None, extra=None, conditionals = None):
@@ -1807,7 +1801,7 @@ def serialize_exports(self, output, file):
18071801

18081802
ids = list(dict.macros.keys())
18091803
ids.sort()
1810-
for id in uniq(ids):
1804+
for id in ids:
18111805
# Macros are sometime used to masquerade other types.
18121806
if id in dict.functions:
18131807
continue
@@ -1822,23 +1816,23 @@ def serialize_exports(self, output, file):
18221816
output.write(" <exports symbol='%s' type='macro'/>\n" % (id))
18231817
ids = list(dict.enums.keys())
18241818
ids.sort()
1825-
for id in uniq(ids):
1819+
for id in ids:
18261820
output.write(" <exports symbol='%s' type='enum'/>\n" % (id))
18271821
ids = list(dict.typedefs.keys())
18281822
ids.sort()
1829-
for id in uniq(ids):
1823+
for id in ids:
18301824
output.write(" <exports symbol='%s' type='typedef'/>\n" % (id))
18311825
ids = list(dict.structs.keys())
18321826
ids.sort()
1833-
for id in uniq(ids):
1827+
for id in ids:
18341828
output.write(" <exports symbol='%s' type='struct'/>\n" % (id))
18351829
ids = list(dict.variables.keys())
18361830
ids.sort()
1837-
for id in uniq(ids):
1831+
for id in ids:
18381832
output.write(" <exports symbol='%s' type='variable'/>\n" % (id))
18391833
ids = list(dict.functions.keys())
18401834
ids.sort()
1841-
for id in uniq(ids):
1835+
for id in ids:
18421836
output.write(" <exports symbol='%s' type='function'/>\n" % (id))
18431837
output.write(" </file>\n")
18441838

0 commit comments

Comments
 (0)