Reuse getTypes in UnionConversions().

This should be equivalent, except that the removed code ignores return
values (which we currently don't support).
This commit is contained in:
Ms2ger 2014-04-29 21:18:56 +02:00
parent 19166b2f53
commit c51879767e

View file

@ -1688,19 +1688,8 @@ def UnionConversions(descriptors):
if not name in unionConversions:
unionConversions[name] = CGUnionConversionStruct(type, d)
members = [m for m in d.interface.members]
if d.interface.ctor():
members.append(d.interface.ctor())
signatures = [s for m in members if m.isMethod() for s in m.signatures()]
for s in signatures:
assert len(s) == 2
(_, arguments) = s
for a in arguments:
addUnionTypes(a.type)
for m in members:
if m.isAttr() and not m.readonly:
addUnionTypes(m.type)
for t in getTypes(d):
addUnionTypes(t)
return CGWrapper(CGList(SortedDictValues(unionConversions), "\n"),
post="\n\n")