diff mbox series

[09/14] qapi/doc.py: Remove one-letter variables

Message ID 20200922211802.4083666-10-jsnow@redhat.com
State New
Headers show
Series qapi: static typing conversion, pt3 | expand

Commit Message

John Snow Sept. 22, 2020, 9:17 p.m. UTC
Signed-off-by: John Snow <jsnow@redhat.com>
---
 scripts/qapi/doc.py | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

Comments

Eduardo Habkost Sept. 23, 2020, 9 p.m. UTC | #1
On Tue, Sep 22, 2020 at 05:17:57PM -0400, John Snow wrote:
> Signed-off-by: John Snow <jsnow@redhat.com>


Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>


-- 
Eduardo
diff mbox series

Patch

diff --git a/scripts/qapi/doc.py b/scripts/qapi/doc.py
index 74d017f60e..5f2b0cd51d 100644
--- a/scripts/qapi/doc.py
+++ b/scripts/qapi/doc.py
@@ -203,17 +203,17 @@  def texi_members(doc: QAPIDoc,
         items += texi_member(section.member, desc, '')
     if base:
         items += '@item The members of @code{%s}\n' % base.doc_type()
-    if variants:
-        for v in variants.variants:
-            when = ' when @code{%s} is @t{"%s"}%s' % (
-                variants.tag_member.name, v.name, texi_if(v.ifcond, " (", ")"))
-            if v.type.is_implicit():
-                assert not v.type.base and not v.type.variants
-                for m in v.type.local_members:
-                    items += texi_member(m, '', when)
-            else:
-                items += '@item The members of @code{%s}%s\n' % (
-                    v.type.doc_type(), when)
+    for variant in variants.variants if variants else ():
+        when = ' when @code{%s} is @t{"%s"}%s' % (
+            variants.tag_member.name, variant.name,
+            texi_if(variant.ifcond, " (", ")"))
+        if variant.type.is_implicit():
+            assert not variant.type.base and not variant.type.variants
+            for member in variant.type.local_members:
+                items += texi_member(member, '', when)
+        else:
+            items += '@item The members of @code{%s}%s\n' % (
+                variant.type.doc_type(), when)
     if not items:
         return ''
     return '\n@b{%s:}\n@table @asis\n%s@end table\n' % (what, items)