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 1     1   221181 use strict;
  1         3  
  1         43  
3 1     1   7 use warnings;
  1         2  
  1         234  
4             our $VERSION = '0.02';
5             require XSLoader;
6             XSLoader::load('Data::Log::Shared', $VERSION);
7              
8             sub each_entry {
9 6     6 0 461765 my ($self, $cb, $from) = @_;
10 6   100     49 $from //= 0;
11 6         34 my $trunc = $self->truncation;
12 6 100       40 $from = $trunc if $from < $trunc;
13 6         17 while (1) {
14 215         589 my ($data, $next) = $self->read_entry($from);
15 215 100       429 last unless defined $data;
16 209         483 $cb->($data, $from);
17 209         547 $from = $next;
18             }
19 6         16 return $from;
20             }
21              
22             1;
23             __END__