aboutsummaryrefslogtreecommitdiff
path: root/scripts/qapi
diff options
context:
space:
mode:
authorJohn Snow <jsnow@redhat.com>2021-04-21 14:20:21 -0400
committerMarkus Armbruster <armbru@redhat.com>2021-04-30 12:59:54 +0200
commit926bb8add7c549496c612fcd4a32f3cf37883c2a (patch)
treebb319e2fa6d2959d8add1d24fc1dc97201d38a07 /scripts/qapi
parentb66c62a2d3318c5d968d5b95428efb74ca5d5702 (diff)
qapi/expr.py: move string check upwards in check_type
For readability purposes only, shimmy the early return upwards to the top of the function, so cases proceed in order from least to most complex. Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Message-Id: <20210421182032.3521476-7-jsnow@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi')
-rw-r--r--scripts/qapi/expr.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py
index 3ab78a555d..c0d18dcc01 100644
--- a/scripts/qapi/expr.py
+++ b/scripts/qapi/expr.py
@@ -171,6 +171,10 @@ def check_type(value, info, source,
if value is None:
return
+ # Type name
+ if isinstance(value, str):
+ return
+
# Array type
if isinstance(value, list):
if not allow_array:
@@ -181,10 +185,6 @@ def check_type(value, info, source,
source)
return
- # Type name
- if isinstance(value, str):
- return
-
# Anonymous type
if not allow_dict: