Eric Blake <ebl...@redhat.com> writes: > From: Markus Armbruster <arm...@redhat.com> > > QAPISchemaObjectTypeMember.check() currently does four things: > > 1. Compute self.type > > 2. Accumulate members in all_members > > Only one caller cares: QAPISchemaObjectType.check() uses it to > compute self.members. The other callers pass a throw-away > accumulator. > > 3. Accumulate a map from names to members in seen > > Only one caller cares: QAPISchemaObjectType.check() uses it to > compute its local variable seen, for self.variants.check(), which > uses it to compute self.variants.tag_member from > self.variants.tag_name. The other callers pass a throw-away > accumulator. > > 4. Check for collisions > > This piggyback on 3: before adding a new entry, we assert it's new.
piggybacks (typo is mine) > > Only one caller cares: QAPISchemaObjectType.check() uses it to > assert non-variant members don't clash. > > Simplify QAPISchemaObjectType.check(): move 2.-4. to > QAPISchemaObjectType.check(), and drop parameters all_members and > seen. > > Signed-off-by: Markus Armbruster <arm...@redhat.com> > Message-Id: <1446559499-26984-2-git-send-email-arm...@redhat.com> > [rebase to earlier changes that moved tag_member.check() of > alternate types] > Signed-off-by: Eric Blake <ebl...@redhat.com> Patch is as good as ever ;)