From ecd128536dcec395876936a8d3abf5a1eea46089 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Tue, 2 Jul 2013 14:38:49 -0600 Subject: [PATCH 24/28] Ticket #47387 - improve logconv.pl performance with large access logs https://fedorahosted.org/389/ticket/47387 Reviewed by: mreynolds (Thanks!) Branch: master Fix Description: Fix some additional uninitialized variable warnings Platforms tested: RHEL6 x86_64 Flag Day: no Doc impact: no (cherry picked from commit 8a23f5e0af41291d28c4ce7251d9bb2e94a5994c) (cherry picked from commit 7a107bdb67dad58728977b3f410df1d94c6cdb91) --- ldap/admin/src/logconv.pl | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ldap/admin/src/logconv.pl b/ldap/admin/src/logconv.pl index b628d03..ec0fdf5 100755 --- a/ldap/admin/src/logconv.pl +++ b/ldap/admin/src/logconv.pl @@ -673,7 +673,7 @@ if ($verb eq "yes" || $usage =~ /u/){ my $notesCount = "1"; my $unindexedIp; - for (my $n = 0; $n <= scalar(@{$notesEtime}); $n++){ + for (my $n = 0; $n < scalar(@{$notesEtime}); $n++){ if($conn_hash->{$notesConn->[$n]} eq ""){ $unindexedIp = "?"; } else { @@ -726,7 +726,7 @@ if ($verb eq "yes" || $usage =~ /u/){ my $notesCount = "1"; my $unindexedIp; - for (my $n = 0; $n <= scalar(@{$notesEtime}); $n++){ + for (my $n = 0; $n < scalar(@{$notesEtime}); $n++){ if($conn_hash->{$notesConn->[$n]} eq ""){ $unindexedIp = "?"; } else { @@ -1821,7 +1821,7 @@ sub parseLineNormal $con = $1; if ($_ =~ /op= *([0-9]+)/i){ $op = $1;} } - for (my $i=0; $i <= $vlvCount;$i++){ + for (my $i=0; $i < $vlvCount;$i++){ if ($vlvconn[$i] eq $con && $vlvop[$i] eq $op){ $vlvNotesACount++; $isVlvNotes="1";} } if($isVlvNotes == 0){ @@ -1846,7 +1846,7 @@ sub parseLineNormal $con = $1; if ($_ =~ /op= *([0-9]+)/i){ $op = $1;} } - for (my $i=0; $i <= $vlvCount;$i++){ + for (my $i=0; $i < $vlvCount;$i++){ if ($vlvconn[$i] eq $con && $vlvop[$i] eq $op){ $vlvNotesUCount++; $isVlvNotes="1";} } if($isVlvNotes == 0){ -- 1.7.1