Filename | /var/www/foswikidev/core/lib/Foswiki/Query/OP_int.pm |
Statements | Executed 14 statements in 263µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
3 | 1 | 1 | 35µs | 81µs | new | Foswiki::Query::OP_int::
1 | 1 | 1 | 13µs | 26µs | BEGIN@11 | Foswiki::Query::OP_int::
1 | 1 | 1 | 9µs | 13µs | BEGIN@12 | Foswiki::Query::OP_int::
1 | 1 | 1 | 7µs | 7µs | BEGIN@14 | Foswiki::Query::OP_int::
0 | 0 | 0 | 0s | 0s | __ANON__[:35] | Foswiki::Query::OP_int::
0 | 0 | 0 | 0s | 0s | evaluate | Foswiki::Query::OP_int::
0 | 0 | 0 | 0s | 0s | evaluatesToConstant | Foswiki::Query::OP_int::
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::Query::OP_int | ||||
6 | |||||
7 | =cut | ||||
8 | |||||
9 | package Foswiki::Query::OP_int; | ||||
10 | |||||
11 | 2 | 26µs | 2 | 40µs | # spent 26µs (13+13) within Foswiki::Query::OP_int::BEGIN@11 which was called:
# once (13µs+13µs) by Foswiki::Query::Parser::BEGIN@68 at line 11 # spent 26µs making 1 call to Foswiki::Query::OP_int::BEGIN@11
# spent 13µs making 1 call to strict::import |
12 | 2 | 33µs | 2 | 17µs | # spent 13µs (9+4) within Foswiki::Query::OP_int::BEGIN@12 which was called:
# once (9µs+4µs) by Foswiki::Query::Parser::BEGIN@68 at line 12 # spent 13µs making 1 call to Foswiki::Query::OP_int::BEGIN@12
# spent 4µs making 1 call to warnings::import |
13 | |||||
14 | 2 | 162µs | 1 | 7µs | # spent 7µs within Foswiki::Query::OP_int::BEGIN@14 which was called:
# once (7µs+0s) by Foswiki::Query::Parser::BEGIN@68 at line 14 # spent 7µs making 1 call to Foswiki::Query::OP_int::BEGIN@14 |
15 | 1 | 7µs | our @ISA = ('Foswiki::Query::UnaryOP'); | ||
16 | |||||
17 | # spent 81µs (35+46) within Foswiki::Query::OP_int::new which was called 3 times, avg 27µs/call:
# 3 times (35µs+46µs) by Foswiki::Query::Parser::new at line 112 of /var/www/foswikidev/core/lib/Foswiki/Query/Parser.pm, avg 27µs/call | ||||
18 | 3 | 1µs | my $class = shift; | ||
19 | 3 | 32µs | 3 | 46µs | return $class->SUPER::new( name => 'int', prec => 1000 ); # spent 46µs making 3 calls to Foswiki::Query::UnaryOP::new, avg 15µs/call |
20 | } | ||||
21 | |||||
22 | sub evaluate { | ||||
23 | my $this = shift; | ||||
24 | my $node = shift; | ||||
25 | |||||
26 | my $a = $node->{params}[0]->evaluate(@_); | ||||
27 | return $this->collect( | ||||
28 | $a, | ||||
29 | sub { | ||||
30 | defined $_[0] | ||||
31 | ? Foswiki::Query::OP::isNumber( $_[0] ) | ||||
32 | ? int( $_[0] ) | ||||
33 | : 0 | ||||
34 | : undef; | ||||
35 | } | ||||
36 | ); | ||||
37 | } | ||||
38 | |||||
39 | sub evaluatesToConstant { | ||||
40 | my $this = shift; | ||||
41 | my $node = shift; | ||||
42 | return $node->{params}[0]->evaluatesToConstant(@_); | ||||
43 | } | ||||
44 | |||||
45 | 1 | 3µs | 1; | ||
46 | __END__ |