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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





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.
--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux