Subject: | Suspicious code in PPI::Structure |
In the elements() method of PPI::Structure, there's a suspicious
repeated block of code that looks like a copy-and-paste error. The
following repeats $self->{start} twice:
# Return the number of elements in scalar context.
# This is memory-cheaper than creating another big array
return scalar(@{$self->{children}})
+ ($self->{start} ? 1 : 0)
+ ($self->{start} ? 1 : 0);
Either the second was meant to be $self->{finish} or the two terms can
be reduced to "$self->{start} ? 2 : 0"