Filename | /usr/local/src/github.com/foswiki/core/lib/Foswiki/If/OP_isempty.pm |
Statements | Executed 10 statements in 407µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 31µs | 60µs | new | Foswiki::If::OP_isempty::
1 | 1 | 1 | 24µs | 32µs | BEGIN@11 | Foswiki::If::OP_isempty::
1 | 1 | 1 | 16µs | 34µs | BEGIN@12 | Foswiki::If::OP_isempty::
1 | 1 | 1 | 8µs | 8µs | BEGIN@14 | Foswiki::If::OP_isempty::
0 | 0 | 0 | 0s | 0s | evaluate | Foswiki::If::OP_isempty::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | |||||
3 | =begin TML | ||||
4 | |||||
5 | ---+ package Foswiki::If::OP_isempty | ||||
6 | |||||
7 | =cut | ||||
8 | |||||
9 | package Foswiki::If::OP_isempty; | ||||
10 | |||||
11 | 2 | 45µs | 2 | 40µs | # spent 32µs (24+8) within Foswiki::If::OP_isempty::BEGIN@11 which was called:
# once (24µs+8µs) by Foswiki::If::Parser::BEGIN@27 at line 11 # spent 32µs making 1 call to Foswiki::If::OP_isempty::BEGIN@11
# spent 8µs making 1 call to strict::import |
12 | 2 | 44µs | 2 | 52µs | # spent 34µs (16+18) within Foswiki::If::OP_isempty::BEGIN@12 which was called:
# once (16µs+18µs) by Foswiki::If::Parser::BEGIN@27 at line 12 # spent 34µs making 1 call to Foswiki::If::OP_isempty::BEGIN@12
# spent 18µs making 1 call to warnings::import |
13 | |||||
14 | 2 | 269µs | 1 | 8µs | # spent 8µs within Foswiki::If::OP_isempty::BEGIN@14 which was called:
# once (8µs+0s) by Foswiki::If::Parser::BEGIN@27 at line 14 # spent 8µs making 1 call to Foswiki::If::OP_isempty::BEGIN@14 |
15 | 1 | 9µs | our @ISA = ('Foswiki::Query::UnaryOP'); | ||
16 | |||||
17 | # spent 60µs (31+29) within Foswiki::If::OP_isempty::new which was called:
# once (31µs+29µs) by Foswiki::If::Parser::new at line 42 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/If/Parser.pm | ||||
18 | 2 | 35µs | my $class = shift; | ||
19 | 1 | 29µs | return $class->SUPER::new( name => 'isempty', prec => 600 ); # spent 29µs making 1 call to Foswiki::Query::UnaryOP::new | ||
20 | } | ||||
21 | |||||
22 | sub evaluate { | ||||
23 | my $this = shift; | ||||
24 | my $node = shift; | ||||
25 | my $a = $node->{params}->[0]; | ||||
26 | my %domain = @_; | ||||
27 | my $session = $domain{tom}->session; | ||||
28 | throw Error::Simple( | ||||
29 | 'No context in which to evaluate "' . $a->stringify() . '"' ) | ||||
30 | unless $session; | ||||
31 | my $eval = $a->_evaluate(@_); | ||||
32 | return 1 unless $eval; | ||||
33 | return 0 if ( $session->{request}->param($eval) ); | ||||
34 | return 0 if ( $session->{prefs}->getPreference($eval) ); | ||||
35 | return 1; | ||||
36 | } | ||||
37 | |||||
38 | 1 | 6µs | 1; | ||
39 | __END__ |