mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-08 12:41:29 +00:00
hvsupport: skip non-matching lines early
Most of the lines we look at are not going to match one of the driver types contained in $groups_regex. Move on to the next line if it does not contain any of them early. This speeds up the script execution by 50%, since this simple regex does not have any capture groups.
This commit is contained in:
parent
6dc1f10347
commit
f1bbf57cad
@ -212,6 +212,9 @@ foreach my $src (@srcs) {
|
|||||||
my $impl;
|
my $impl;
|
||||||
while (defined($line = <FILE>)) {
|
while (defined($line = <FILE>)) {
|
||||||
if (!$ingrp) {
|
if (!$ingrp) {
|
||||||
|
# skip non-matching lines early to save time
|
||||||
|
next if not $line =~ /$groups_regex/;
|
||||||
|
|
||||||
if ($line =~ /^\s*(?:static\s+)?($groups_regex)\s+(\w+)\s*=\s*{/ ||
|
if ($line =~ /^\s*(?:static\s+)?($groups_regex)\s+(\w+)\s*=\s*{/ ||
|
||||||
$line =~ /^\s*(?:static\s+)?($groups_regex)\s+NAME\(\w+\)\s*=\s*{/) {
|
$line =~ /^\s*(?:static\s+)?($groups_regex)\s+NAME\(\w+\)\s*=\s*{/) {
|
||||||
$ingrp = $1;
|
$ingrp = $1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user