[libvirt] [PATCH 4/4] hvsupport: skip non-matching lines early

Ján Tomko jtomko at redhat.com
Wed Jun 29 06:40:18 UTC 2016


This speeds up the whole script almost twice.
---
 docs/hvsupport.pl | 1 +
 1 file changed, 1 insertion(+)

diff --git a/docs/hvsupport.pl b/docs/hvsupport.pl
index 31821ad..8b2f8c6 100755
--- a/docs/hvsupport.pl
+++ b/docs/hvsupport.pl
@@ -209,6 +209,7 @@ foreach my $src (@srcs) {
     my $impl;
     while (defined($line = <FILE>)) {
         if (!$ingrp) {
+            next if not $line =~ /$grps/;
             if ($line =~ /^\s*(?:static\s+)?($grps)\s+(\w+)\s*=\s*{/ ||
                 $line =~ /^\s*(?:static\s+)?($grps)\s+NAME\(\w+\)\s*=\s*{/) {
                 $ingrp = $1;
-- 
2.7.3




More information about the libvir-list mailing list