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

2020-09-23 Thread Eduardo Habkost
On Tue, Sep 22, 2020 at 05:17:57PM -0400, John Snow wrote:
> Signed-off-by: John Snow 

Reviewed-by: Eduardo Habkost 

-- 
Eduardo




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

2020-09-22 Thread John Snow
Signed-off-by: John Snow 
---
 scripts/qapi/doc.py | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

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)
-- 
2.26.2