Filename | /var/www/foswikidev/core/lib/Foswiki/If/OP_isempty.pm |
Statements | Executed 11 statements in 266µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 14µs | 27µs | new | Foswiki::If::OP_isempty::
1 | 1 | 1 | 13µs | 25µs | BEGIN@11 | Foswiki::If::OP_isempty::
1 | 1 | 1 | 9µs | 13µs | BEGIN@12 | Foswiki::If::OP_isempty::
1 | 1 | 1 | 3µs | 3µs | BEGIN@17 | Foswiki::If::OP_isempty::
1 | 1 | 1 | 3µs | 3µ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 | 25µs | 2 | 37µs | # spent 25µs (13+12) within Foswiki::If::OP_isempty::BEGIN@11 which was called:
# once (13µs+12µs) by Foswiki::If::Parser::BEGIN@27 at line 11 # spent 25µs making 1 call to Foswiki::If::OP_isempty::BEGIN@11
# spent 12µs making 1 call to strict::import |
12 | 2 | 22µs | 2 | 17µs | # spent 13µs (9+4) within Foswiki::If::OP_isempty::BEGIN@12 which was called:
# once (9µs+4µs) by Foswiki::If::Parser::BEGIN@27 at line 12 # spent 13µs making 1 call to Foswiki::If::OP_isempty::BEGIN@12
# spent 4µs making 1 call to warnings::import |
13 | |||||
14 | 2 | 48µs | 1 | 3µs | # spent 3µs within Foswiki::If::OP_isempty::BEGIN@14 which was called:
# once (3µs+0s) by Foswiki::If::Parser::BEGIN@27 at line 14 # spent 3µs making 1 call to Foswiki::If::OP_isempty::BEGIN@14 |
15 | 1 | 7µs | our @ISA = ('Foswiki::Query::UnaryOP'); | ||
16 | |||||
17 | # spent 3µs within Foswiki::If::OP_isempty::BEGIN@17 which was called:
# once (3µs+0s) by Foswiki::If::Parser::BEGIN@27 at line 22 | ||||
18 | 1 | 4µs | if ( $Foswiki::cfg{UseLocale} ) { | ||
19 | require locale; | ||||
20 | import locale(); | ||||
21 | } | ||||
22 | 1 | 141µs | 1 | 3µs | } # spent 3µs making 1 call to Foswiki::If::OP_isempty::BEGIN@17 |
23 | |||||
24 | # spent 27µs (14+13) within Foswiki::If::OP_isempty::new which was called:
# once (14µs+13µs) by Foswiki::If::Parser::new at line 49 of /var/www/foswikidev/core/lib/Foswiki/If/Parser.pm | ||||
25 | 1 | 400ns | my $class = shift; | ||
26 | 1 | 15µs | 1 | 13µs | return $class->SUPER::new( name => 'isempty', prec => 600 ); # spent 13µs making 1 call to Foswiki::Query::UnaryOP::new |
27 | } | ||||
28 | |||||
29 | sub evaluate { | ||||
30 | my $this = shift; | ||||
31 | my $node = shift; | ||||
32 | my $a = $node->{params}->[0]; | ||||
33 | my %domain = @_; | ||||
34 | my $session = $domain{tom}->session; | ||||
35 | throw Error::Simple( | ||||
36 | 'No context in which to evaluate "' . $a->stringify() . '"' ) | ||||
37 | unless $session; | ||||
38 | my $eval = $a->_evaluate(@_); | ||||
39 | return 1 unless $eval; | ||||
40 | return 0 if ( $session->{request}->param($eval) ); | ||||
41 | return 0 if ( $session->{prefs}->getPreference($eval) ); | ||||
42 | return 1; | ||||
43 | } | ||||
44 | |||||
45 | 1 | 3µs | 1; | ||
46 | __END__ |