Ref/CLOCK.pm

filter: Statementstmt 100% 16 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 100% 21 / 21 CC 2 SCAR 2.9
CC
2
Cov
100%
_hit
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« Ref/Null.pm ↑ Summary Ref/GCLOCK.pm »
1 package Cache::Ref::CLOCK;
2 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 $Cache::Ref::CLOCK::AUTHORITY = 'cpan:NUFFIN';
4 }
5 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 $Cache::Ref::CLOCK::VERSION = '0.05'; # TRIAL
7 }
8 # ABSTRACT: CLOCK cache replacement algorithm
9  
10 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 1 extends qw(Cache::Ref);
15  
16 1 with qw(Cache::Ref::CLOCK::Base);
17  
18 1 has k => (
19 isa => "Int",
20 is => "ro",
21 default => 1,
22 );
23  
24 3026 ▶sub _hit {
Subroutine _hit: called CC=2 SCAR=6.9
25 3026 my ( $self, $e ) = @_;
26  
27 3026 my $k = 0+$self->k; # moose stingifies default
28 3026 $_->[0] = $k for @$e;
29 }
30  
31 1 __PACKAGE__->meta->make_immutable;
32  
33 1 __PACKAGE__;
34  
35  
36 # ex: set sw=4 et:
37  
38 __END__
« Ref/Null.pm ↑ Summary Ref/GCLOCK.pm »