From: John Snow Date: Wed, 21 Apr 2021 18:20:31 +0000 (-0400) Subject: qapi/expr.py: Use tuples instead of lists for static data X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=eab99939a7cd289a8b50c2e7ef6a38ca2706a46c;p=qemu.git 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 --- 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)