[libvirt] [PATCH 09/22] apibuild: Simplify conditional statements

Radostin Stoyanov rstoyanov1 at gmail.com
Mon Mar 19 15:45:50 UTC 2018



On 19/03/18 10:52, Daniel P. Berrangé wrote:
>> -                o = ord(line[i])
>> -                if (o >= 97 and o <= 122) or (o >= 65 and o <= 90) or \
>> -                   (o >= 48 and o <= 57):
>> +                if re.match(r"[a-zA-Z0-9]", line[i]):
> Why not just use   isalnum() function here - it will be massively
> faster than a regex match.
>
Thanks, I didn't know about isalnum(). I will resend the patch.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20180319/1c5e7d19/attachment-0001.htm>


More information about the libvir-list mailing list