From eab99939a7cd289a8b50c2e7ef6a38ca2706a46c Mon Sep 17 00:00:00 2001 From: John Snow Date: Wed, 21 Apr 2021 14:20:31 -0400 Subject: [PATCH] qapi/expr.py: Use tuples instead of lists for static data It is -- maybe -- possibly -- three nanoseconds faster. Signed-off-by: John Snow Reviewed-by: Eduardo Habkost Reviewed-by: Cleber Rosa Message-Id: <20210421182032.3521476-17-jsnow@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/expr.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index 0b66d80842..225a82e20d 100644 --- a/scripts/qapi/expr.py +++ b/scripts/qapi/expr.py @@ -239,11 +239,11 @@ def check_flags(expr: _JSONObject, info: QAPISourceInfo) -> None: When certain flags have an invalid value, or when incompatible flags are present. """ - for key in ['gen', 'success-response']: + for key in ('gen', 'success-response'): if key in expr and expr[key] is not False: raise QAPISemError( info, "flag '%s' may only use false value" % key) - for key in ['boxed', 'allow-oob', 'allow-preconfig', 'coroutine']: + for key in ('boxed', 'allow-oob', 'allow-preconfig', 'coroutine'): if key in expr and expr[key] is not True: raise QAPISemError( info, "flag '%s' may only use true value" % key) -- 2.11.0