Filename | /var/www/foswiki11/lib/Foswiki/If/OP_isempty.pm |
Statements | Executed 10 statements in 348µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 24µs | 48µs | new | Foswiki::If::OP_isempty::
1 | 1 | 1 | 23µs | 41µs | BEGIN@11 | Foswiki::If::OP_isempty::
1 | 1 | 1 | 13µs | 20µs | BEGIN@12 | Foswiki::If::OP_isempty::
1 | 1 | 1 | 5µs | 5µ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 | 41µs | 2 | 59µs | # spent 41µs (23+18) within Foswiki::If::OP_isempty::BEGIN@11 which was called:
# once (23µs+18µs) by Foswiki::If::Parser::new at line 11 # spent 41µs making 1 call to Foswiki::If::OP_isempty::BEGIN@11
# spent 18µs making 1 call to strict::import |
12 | 2 | 38µs | 2 | 27µs | # spent 20µs (13+7) within Foswiki::If::OP_isempty::BEGIN@12 which was called:
# once (13µs+7µs) by Foswiki::If::Parser::new at line 12 # spent 20µs making 1 call to Foswiki::If::OP_isempty::BEGIN@12
# spent 7µs making 1 call to warnings::import |
13 | |||||
14 | 2 | 231µs | 1 | 5µs | # spent 5µs within Foswiki::If::OP_isempty::BEGIN@14 which was called:
# once (5µs+0s) by Foswiki::If::Parser::new at line 14 # spent 5µs making 1 call to Foswiki::If::OP_isempty::BEGIN@14 |
15 | 1 | 11µs | our @ISA = ('Foswiki::Query::UnaryOP'); | ||
16 | |||||
17 | # spent 48µs (24+24) within Foswiki::If::OP_isempty::new which was called:
# once (24µs+24µs) by Foswiki::If::Parser::new at line 31 of /var/www/foswiki11/lib/Foswiki/If/Parser.pm | ||||
18 | 1 | 800ns | my $class = shift; | ||
19 | 1 | 22µs | 1 | 24µs | return $class->SUPER::new( name => 'isempty', prec => 600 ); # spent 24µ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 | 4µs | 1; | ||
39 | __END__ |