[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 05/16] qapi/expr.py: move string check upwards in check_type
From: |
John Snow |
Subject: |
[PATCH 05/16] qapi/expr.py: move string check upwards in check_type |
Date: |
Tue, 22 Sep 2020 17:13:02 -0400 |
It's a simple case, shimmy the early return upwards.
Signed-off-by: John Snow <jsnow@redhat.com>
---
scripts/qapi/expr.py | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py
index 67892502e9..3f5af5f5e4 100644
--- a/scripts/qapi/expr.py
+++ b/scripts/qapi/expr.py
@@ -143,6 +143,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:
@@ -153,10 +157,6 @@ def check_type(value, info, source,
source)
return
- # Type name
- if isinstance(value, str):
- return
-
# Anonymous type
if not allow_dict:
--
2.26.2
[PATCH 07/16] qapi/expr.py: Add casts in a few select cases, John Snow, 2020/09/22