]> xenbits.xensource.com Git - libvirt.git/commit
apibuild: Simplify conditional statements
authorRadostin Stoyanov <rstoyanov1@gmail.com>
Tue, 20 Mar 2018 06:48:53 +0000 (06:48 +0000)
committerDaniel P. Berrangé <berrange@redhat.com>
Tue, 20 Mar 2018 12:13:35 +0000 (12:13 +0000)
commite390bb1571d7add0440bfb92cc29beb8159d4695
tree52232b0d9b5ce93ab59194f2d40a1477654029c5
parente9476e103527304181c616e181710bae07b53d25
apibuild: Simplify conditional statements

Improve readability by reducing the complexity and length of
conditional statements.

Example: The following condition:

if (o >= 97 and o <= 122) or
   (o >= 65 and o <= 90) or
   (o >= 48 and o <= 57) or
   (" \t(){}:;,+-*/%&!|[]=><".find(line[i]) == -1):

Will be True for every character that is not in string:
" \t(){}:;,+-*/%&!|[]=><"

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Radostin Stoyanov <rstoyanov1@gmail.com>
docs/apibuild.py