line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OPTIMADE::Filter::Modifiable; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
85397
|
use strict; |
|
7
|
|
|
|
|
34
|
|
|
7
|
|
|
|
|
211
|
|
4
|
7
|
|
|
7
|
|
39
|
use warnings; |
|
7
|
|
|
|
|
11
|
|
|
7
|
|
|
|
|
218
|
|
5
|
|
|
|
|
|
|
|
6
|
7
|
|
|
7
|
|
38
|
use Scalar::Util qw(blessed); |
|
7
|
|
|
|
|
14
|
|
|
7
|
|
|
|
|
1513
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.10.2'; # VERSION |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub modify |
11
|
|
|
|
|
|
|
{ |
12
|
29
|
|
|
29
|
0
|
726
|
my $node = shift; |
13
|
29
|
|
|
|
|
41
|
my $code = shift; |
14
|
|
|
|
|
|
|
|
15
|
29
|
100
|
100
|
|
|
180
|
if( blessed $node && |
|
|
50
|
|
|
|
|
|
16
|
|
|
|
|
|
|
$node->isa( OPTIMADE::Filter::Modifiable:: ) ) { |
17
|
12
|
|
|
|
|
51
|
return $node->modify( $code, @_ ); |
18
|
|
|
|
|
|
|
} elsif( ref $node eq 'ARRAY' ) { |
19
|
0
|
|
|
|
|
0
|
return [ map { modify( $_, $code, @_ ) } @$node ]; |
|
0
|
|
|
|
|
0
|
|
20
|
|
|
|
|
|
|
} else { |
21
|
17
|
|
|
|
|
61
|
return $code->( $node, @_ ); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |