From 8b5580ec40946e6edf486b69b288a5d2ff4ab776 Mon Sep 17 00:00:00 2001 From: Angel Ortega Date: Tue, 31 Jan 2012 13:44:06 +0100 Subject: [PATCH] Code cleaning bin/gruta-snapshot. --- bin/gruta-snapshot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/gruta-snapshot b/bin/gruta-snapshot index 9d56544..b632f79 100755 --- a/bin/gruta-snapshot +++ b/bin/gruta-snapshot @@ -116,18 +116,18 @@ foreach my $t (sort $g->source->topics()) { } out($g, 'TOPIC', "$t/index.html", { 'topic' => $t, 'num' => $step }); - foreach my $i (1..$step) { shift(@stories); } + my $max = scalar(@stories) - $step; my $offset = $step; - while (@stories) { + while ($max > 0) { out($g, 'TOPIC', "$t/~${offset}.html", { topic => $t, num => $step, offset => $offset } ); - foreach my $i (1..$step) { shift(@stories); } + $max -= $step; $offset += $step; } } -- 2.11.4.GIT