changeset 55:656b2a22b945

Merged.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 23 Oct 2012 19:01:11 +0300
parents 0d574e3248b5 (current diff) 1c5174dcd92a (diff)
children 5adf3ec26aa0
files parsedata.pl
diffstat 1 files changed, 3 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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");