| 1 | package Data::Range::Compare::Stream::Iterator::Stack; | ||||||||||
| 2 | |||||||||||
| 3 | 3 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 3 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 3 | ▶ | use base qw(Data::Range::Compare::Stream::Iterator::Base); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 14 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 8 | 14 | my ($class,%args)=@_; | |||||||||
| 9 | 14 | my $self=$class->SUPER::new(stack=>[],%args); | |||||||||
| 10 | } | ||||||||||
| 11 | |||||||||||
| 12 | 3 | ▶ | sub stack_push { | ||||||||
|
Subroutine
stack_push: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 13 | 3 | my ($self,$it)=@_; | |||||||||
| 14 | 3 | push @{$self->{stack}},$it; | |||||||||
| 15 | } | ||||||||||
| 16 | |||||||||||
| 17 | 8264 | ▶ | sub has_next { | ||||||||
|
Subroutine
has_next: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 18 | 8264 | my ($self)=@_; | |||||||||
| 19 | 8264 | my $stack=$self->{stack}; | |||||||||
| 20 | 8264 | ▶ | while($#$stack!=-1) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 21 | 8270 | ▶ | return 1 if $stack->[0]->has_next; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | 22 | shift @$stack; | |||||||||
| 23 | } | ||||||||||
| 24 | 16 | return 0; | |||||||||
| 25 | } | ||||||||||
| 26 | |||||||||||
| 27 | 8247 | ▶ | sub get_next { $_[0]->{stack}->[0]->get_next } | ||||||||
|
Subroutine
get_next: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 28 | |||||||||||
| 29 | |||||||||||
| 30 | 3 | 1; | |||||||||