Filename | /var/www/foswikidev/core/lib/Foswiki/Query/OP_comma.pm |
Statements | Executed 16 statements in 240µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
4 | 2 | 2 | 49µs | 71µs | new | Foswiki::Query::OP_comma::
1 | 1 | 1 | 14µs | 26µs | BEGIN@12 | Foswiki::Query::OP_comma::
1 | 1 | 1 | 10µs | 14µs | BEGIN@13 | Foswiki::Query::OP_comma::
1 | 1 | 1 | 4µs | 4µs | BEGIN@15 | Foswiki::Query::OP_comma::
0 | 0 | 0 | 0s | 0s | evaluate | Foswiki::Query::OP_comma::
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_comma | ||||
6 | List-building n-ary operator. | ||||
7 | |||||
8 | =cut | ||||
9 | |||||
10 | package Foswiki::Query::OP_comma; | ||||
11 | |||||
12 | 2 | 27µs | 2 | 39µs | # spent 26µs (14+12) within Foswiki::Query::OP_comma::BEGIN@12 which was called:
# once (14µs+12µs) by Foswiki::Query::Node::BEGIN@75 at line 12 # spent 26µs making 1 call to Foswiki::Query::OP_comma::BEGIN@12
# spent 12µs making 1 call to strict::import |
13 | 2 | 24µs | 2 | 18µs | # spent 14µs (10+4) within Foswiki::Query::OP_comma::BEGIN@13 which was called:
# once (10µs+4µs) by Foswiki::Query::Node::BEGIN@75 at line 13 # spent 14µs making 1 call to Foswiki::Query::OP_comma::BEGIN@13
# spent 4µs making 1 call to warnings::import |
14 | |||||
15 | 2 | 136µs | 1 | 4µs | # spent 4µs within Foswiki::Query::OP_comma::BEGIN@15 which was called:
# once (4µs+0s) by Foswiki::Query::Node::BEGIN@75 at line 15 # spent 4µs making 1 call to Foswiki::Query::OP_comma::BEGIN@15 |
16 | 1 | 7µs | our @ISA = ('Foswiki::Query::OP'); | ||
17 | |||||
18 | # spent 71µs (49+22) within Foswiki::Query::OP_comma::new which was called 4 times, avg 18µs/call:
# 3 times (29µs+13µs) by Foswiki::Query::Parser::new at line 112 of /var/www/foswikidev/core/lib/Foswiki/Query/Parser.pm, avg 14µs/call
# once (20µs+9µs) by Foswiki::Query::Node::BEGIN@75 at line 79 of /var/www/foswikidev/core/lib/Foswiki/Query/Node.pm | ||||
19 | 4 | 2µs | my $class = shift; | ||
20 | |||||
21 | # Treated as arity 2 for parsing, but folds to n-ary | ||||
22 | 4 | 42µs | 4 | 22µs | return $class->SUPER::new( # spent 22µs making 4 calls to Foswiki::Query::OP::new, avg 6µs/call |
23 | arity => 2, | ||||
24 | canfold => 1, | ||||
25 | name => ',', | ||||
26 | prec => 400, | ||||
27 | canfold => 1 | ||||
28 | ); | ||||
29 | } | ||||
30 | |||||
31 | sub evaluate { | ||||
32 | my $this = shift; | ||||
33 | my $node = shift; | ||||
34 | my @res; | ||||
35 | foreach my $p ( @{ $node->{params} } ) { | ||||
36 | my $a = $p->evaluate(@_); | ||||
37 | if ( ref($a) eq 'ARRAY' ) { | ||||
38 | push( @res, @$a ); | ||||
39 | } | ||||
40 | else { | ||||
41 | push( @res, $a ); | ||||
42 | } | ||||
43 | } | ||||
44 | return \@res; | ||||
45 | } | ||||
46 | |||||
47 | 1 | 3µs | 1; | ||
48 | __END__ |