File Coverage

blib/lib/Data/RingBuffer/Shared.pm
Criterion Covered Total %
statement 12 12 100.0
branch 1 2 50.0
condition n/a
subroutine 3 3 100.0
pod 0 1 0.0
total 16 18 88.8


line stmt bran cond sub pod time code
1             package Data::RingBuffer::Shared;
2 1     1   215432 use strict;
  1         3  
  1         43  
3 1     1   5 use warnings;
  1         2  
  1         281  
4             our $VERSION = '0.01';
5             require XSLoader;
6             XSLoader::load('Data::RingBuffer::Shared', $VERSION);
7             @Data::RingBuffer::Shared::Int::ISA = ('Data::RingBuffer::Shared');
8             @Data::RingBuffer::Shared::F64::ISA = ('Data::RingBuffer::Shared');
9              
10             sub to_list {
11 1     1 0 246340 my ($self) = @_;
12 1         6 my $sz = $self->size;
13 1 50       4 return () unless $sz;
14 1         3 grep { defined } map { $self->latest($sz - 1 - $_) } 0 .. $sz - 1;
  5         8  
  5         11  
15             }
16              
17             1;
18             __END__