Use Perl constructs that are somewhat cleaner.
authorhpa <hpa>
Tue, 10 Apr 2001 04:13:30 +0000 (04:13 +0000)
committerhpa <hpa>
Tue, 10 Apr 2001 04:13:30 +0000 (04:13 +0000)
lss16toppm

index 8a9d59c..1e1bbba 100755 (executable)
@@ -101,11 +101,8 @@ for ( $y = 0 ; $y < $ysize ; $y++ ) {
            # Truncate overlong runs
            $c = $xsize-$x if ( $c > $xsize-$x );
            # Output run
-           while ( $c ) {
-               print $color{$n};
-               $c--;
-               $x++;
-           }
+           print $color{$n} x $c;
+           $x += $c;
        }
     }
 }