]> xenbits.xensource.com Git - libvirt.git/commit
scripts: speedup prohibit-duplicate-header
authorJán Tomko <jtomko@redhat.com>
Wed, 9 Oct 2019 19:02:38 +0000 (21:02 +0200)
committerJán Tomko <jtomko@redhat.com>
Fri, 22 Nov 2019 10:40:52 +0000 (11:40 +0100)
commit424a385c3ab8d0c9359e310364f1ec5cf32fe854
treea7bdb1e6cdba2ae835200da8960db108d5f89a25
parent05d28facb5529d946bc8fa96e30e7f5533b1eb12
scripts: speedup prohibit-duplicate-header

Running regular expressions with capture groups is expensive.
Bail out early if the line does not start with a '#'.

This reduces the runtime of the check by two thirds.

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/prohibit-duplicate-header.py