]> xenbits.xensource.com Git - libvirt.git/commit
scripts: check-aclrules: use in instead of find
authorJán Tomko <jtomko@redhat.com>
Wed, 20 Nov 2019 18:05:13 +0000 (19:05 +0100)
committerJán Tomko <jtomko@redhat.com>
Fri, 22 Nov 2019 10:40:52 +0000 (11:40 +0100)
commit988f02a99c6166b8dcc70f9a6b162a3ad285fa13
treed0702373563b48af21cd71afc4d04268e755acaf
parent424a385c3ab8d0c9359e310364f1ec5cf32fe854
scripts: check-aclrules: use in instead of find

For checking whether a substring is present in a string,
using the pattern:
    "str" in string
is slightly faster than:
    string.find("str") != -1

Use it to shave off 4 % of the runtime of this script that
processes quite a few long source files.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Daniel Henrique Barboza <danielhb413@gmail.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
scripts/check-aclrules.py