# HG changeset patch # User Matti Hamalainen # Date 1351008071 -10800 # Node ID 656b2a22b945648caaa89f57ea44115da88e9f05 # Parent 0d574e3248b579d8d643e5c65b389399d1f7e250# Parent 1c5174dcd92ac63c02ecf4d121adea34ae1219ac Merged. diff -r 0d574e3248b5 -r 656b2a22b945 parsedata.pl --- a/parsedata.pl Tue Oct 23 19:00:19 2012 +0300 +++ b/parsedata.pl Tue Oct 23 19:01:11 2012 +0300 @@ -274,7 +274,7 @@ my $q = $$node{"nodes"}; my $hourDefs = {}; my $hourTable = {}; -my $maxDays = 6; +my $maxDays = 0; my $maxHours = 0; # Skip zero position this way (can't use foreach here) @@ -312,9 +312,10 @@ } my $cday = 0; - for (my $x = 0; $x < $maxDays; $x++) { + for (my $x = 0; $x < 7; $x++) { if (!defined($$hourTable{$maxHours}{$x})) { $cday = $x; + $maxDays = $x if ($x > $maxDays); last; } } @@ -343,15 +344,6 @@ $maxHours-- if ($flag); } -$flag = 1; -for (my $x = $maxDays - 1; $x >= 0 && $flag; $x--) { - for (my $y = 0; $y < $maxHours && $flag; $y++) { - $flag = 0 if (defined($$hourTable{$y}{$x}) && $$hourTable{$y}{$x} != 0); - } - $maxDays-- if ($flag); -} - - ### Open output file, if specified if (defined($opt_outfile)) { open(STDOUT, '>', $opt_outfile) or die("Could not open output file '$opt_outfile'.\n");