aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--challenge-228/steven-wilson/perl/ch-02.pl5
1 files changed, 2 insertions, 3 deletions
diff --git a/challenge-228/steven-wilson/perl/ch-02.pl b/challenge-228/steven-wilson/perl/ch-02.pl
index 2af5a79c64..17b0e0689e 100644
--- a/challenge-228/steven-wilson/perl/ch-02.pl
+++ b/challenge-228/steven-wilson/perl/ch-02.pl
@@ -12,16 +12,15 @@ done_testing();
sub empty_array {
my @elements = @_;
my $ops = 0;
- while ( @elements ) {
+ while (@elements) {
if ( min(@elements) == $elements[0] ) {
shift @elements;
- $ops++;
}
else {
my $element = shift @elements;
push @elements, $element;
- $ops++;
}
+ $ops++;
}
return $ops;
}