Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[operators] lifted variable out of loop
It doesn't change with each iteration, so it might as well be defined
outside of the loop.

Commit courtesy of Håkan Kjellerstrand.
  • Loading branch information
Carl Masak committed Feb 9, 2011
1 parent 4e2ec42 commit 1ba76c9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/operators.pod
Expand Up @@ -21,9 +21,9 @@ horizontal bars:
my $label-area-width = 1 + [max] @scores».key».chars;
my $max-score = [max] @scores».value;
my $unit = ($screen-width - $label-area-width) / $max-score;
my $format = '%- ' ~ $label-area-width ~ "s%s\n";

for @scores {
my $format = '%- ' ~ $label-area-width ~ "s%s\n";
printf $format, .key, 'X' x ($unit * .value);
}

Expand Down

0 comments on commit 1ba76c9

Please sign in to comment.