File Coverage

blib/lib/Data/Log/Shared.pm
Criterion Covered Total %
statement 16 16 100.0
branch 4 4 100.0
condition 2 2 100.0
subroutine 3 3 100.0
pod 0 1 0.0
total 25 26 96.1


line stmt bran cond sub pod time code
1             package Data::Log::Shared;
2 6     6   677666 use strict;
  6         11  
  6         195  
3 6     6   37 use warnings;
  6         10  
  6         1252  
4             our $VERSION = '0.03';
5             require XSLoader;
6             XSLoader::load('Data::Log::Shared', $VERSION);
7              
8             sub each_entry {
9 9     9 0 770630 my ($self, $cb, $from) = @_;
10 9   100     64 $from //= 0;
11 9         54 my $trunc = $self->truncation;
12 9 100       33 $from = $trunc if $from < $trunc;
13 9         15 while (1) {
14 230         399 my ($data, $next) = $self->read_entry($from);
15 230 100       336 last unless defined $data;
16 221         349 $cb->($data, $from);
17 221         357 $from = $next;
18             }
19 9         22 return $from;
20             }
21              
22             1;
23             __END__