Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the PPI CPAN distribution.

Report information
The Basics
Id: 19614
Status: resolved
Priority: 0/
Queue: PPI

People
Owner: Nobody in particular
Requestors: cpan [...] clotho.com
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in: 1.114
Fixed in: (no value)



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"
Yep, typo. Fixed, and will appear in 1.15. If you would like commit on PPI so you can fix small bugs like this yourself in future, email me (adamk at cpan dot org) and I'll set you up with it.