Skip to content

Commit 010600a

Browse files
committed
[99-problems] .elems unnecessary when performing math ops on an array
1 parent 398c217 commit 010600a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

categories/99-problems/P06-ajscogo.pl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
=end pod
99

1010
sub palindromic(@list) {
11-
if @list.elems < 2 {
11+
if @list < 2 {
1212
return True;
1313
}
1414
my $start = 0;
15-
my $end = @list.elems - 1;
16-
my $mid_start = floor(@list.elems / 2 - 1);
17-
my $mid_end = ceiling(@list.elems / 2);
15+
my $end = @list - 1;
16+
my $mid_start = floor(@list / 2 - 1);
17+
my $mid_end = ceiling(@list / 2);
1818
@list[$start .. $mid_start] ~~ @list[$mid_end .. $end].reverse;
1919
}
2020

0 commit comments

Comments
 (0)