line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OPTIMADE::Filter::Modifiable; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
82993
|
use strict; |
|
7
|
|
|
|
|
31
|
|
|
7
|
|
|
|
|
198
|
|
4
|
7
|
|
|
7
|
|
36
|
use warnings; |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
216
|
|
5
|
|
|
|
|
|
|
|
6
|
7
|
|
|
7
|
|
40
|
use Scalar::Util qw(blessed); |
|
7
|
|
|
|
|
18
|
|
|
7
|
|
|
|
|
1254
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub modify |
9
|
|
|
|
|
|
|
{ |
10
|
29
|
|
|
29
|
0
|
654
|
my $node = shift; |
11
|
29
|
|
|
|
|
43
|
my $code = shift; |
12
|
|
|
|
|
|
|
|
13
|
29
|
100
|
100
|
|
|
153
|
if( blessed $node && |
|
|
50
|
|
|
|
|
|
14
|
|
|
|
|
|
|
$node->isa( OPTIMADE::Filter::Modifiable:: ) ) { |
15
|
12
|
|
|
|
|
66
|
return $node->modify( $code, @_ ); |
16
|
|
|
|
|
|
|
} elsif( ref $node eq 'ARRAY' ) { |
17
|
0
|
|
|
|
|
0
|
return [ map { modify( $_, $code, @_ ) } @$node ]; |
|
0
|
|
|
|
|
0
|
|
18
|
|
|
|
|
|
|
} else { |
19
|
17
|
|
|
|
|
43
|
return $code->( $node, @_ ); |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |