quoted-strings: Merge comparisons with `in`

To check if a variable is equal to one of many values, combine the
values into a tuple and check if the variable is contained in it
instead of checking for equality against each of the values. This
is faster, less verbose, and more readable.
pull/484/head
Dimitri Papadopoulos 3 years ago
parent 008db4aa09
commit 60b0f9f21f
No known key found for this signature in database
GPG Key ID: 95998121D9D25F5D

@ -228,7 +228,7 @@ def check(conf, token, prev, next, nextnext, context):
return
# Ignore multi-line strings
if (not token.plain) and (token.style == "|" or token.style == ">"):
if not token.plain and token.style in ("|", ">"):
return
quote_type = conf['quote-type']

Loading…
Cancel
Save