From a143aa49f06c1fd785cd999dfffb8832c0c337d0 Mon Sep 17 00:00:00 2001 From: Thierry Vignaud Date: Thu, 11 Mar 2004 09:32:36 +0000 Subject: (parse_file) speed up it by 20% (#8412) but logcolorize is the top one in profiles --- perl-install/standalone/logdrake | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'perl-install/standalone/logdrake') diff --git a/perl-install/standalone/logdrake b/perl-install/standalone/logdrake index b484bf3cb..67eef87d2 100755 --- a/perl-install/standalone/logdrake +++ b/perl-install/standalone/logdrake @@ -253,6 +253,15 @@ sub parse_file { my $taille = @all; my $i = 0; + my $test; + if ($en && !$ey) { + $test = sub { !/$en/o }; + } elsif ($ey && !$en) { + $test = sub { /$ey/o }; + } else { + $test = sub { /$ey/o && !/$en/o }; + } + foreach (@all) { $i++; if ($pbar && $i % 10) { @@ -260,9 +269,7 @@ sub parse_file { $win_pb->window->process_updates(1); # no gtkflush() because we do not want to refresh the TextView } - if ($en eq "" && /$ey/i) { logcolorize($_); next } - if (! /$en/i && /$ey/i) { logcolorize($_); next } - if (! /$en/i && $ey eq "") { logcolorize($_); next } + logcolorize($_) if $test; } $win_pb->destroy if !$::isEmbedded || !$isExplain; -- cgit v1.2.1