Filename | /usr/local/src/github.com/foswiki/core/lib/Foswiki/Query/OP_comma.pm |
Statements | Executed 16 statements in 428µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
4 | 2 | 2 | 96µs | 150µs | new | Foswiki::Query::OP_comma::
1 | 1 | 1 | 36µs | 43µs | BEGIN@12 | Foswiki::Query::OP_comma::
1 | 1 | 1 | 16µs | 34µs | BEGIN@13 | Foswiki::Query::OP_comma::
1 | 1 | 1 | 9µs | 9µ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 | 48µs | 2 | 51µs | # spent 43µs (36+7) within Foswiki::Query::OP_comma::BEGIN@12 which was called:
# once (36µs+7µs) by Foswiki::Query::Node::BEGIN@75 at line 12 # spent 43µs making 1 call to Foswiki::Query::OP_comma::BEGIN@12
# spent 7µs making 1 call to strict::import |
13 | 2 | 44µs | 2 | 52µs | # spent 34µs (16+18) within Foswiki::Query::OP_comma::BEGIN@13 which was called:
# once (16µs+18µs) by Foswiki::Query::Node::BEGIN@75 at line 13 # spent 34µs making 1 call to Foswiki::Query::OP_comma::BEGIN@13
# spent 18µs making 1 call to warnings::import |
14 | |||||
15 | 2 | 238µs | 1 | 9µs | # spent 9µs within Foswiki::Query::OP_comma::BEGIN@15 which was called:
# once (9µs+0s) by Foswiki::Query::Node::BEGIN@75 at line 15 # spent 9µs making 1 call to Foswiki::Query::OP_comma::BEGIN@15 |
16 | 1 | 9µs | our @ISA = ('Foswiki::Query::OP'); | ||
17 | |||||
18 | # spent 150µs (96+54) within Foswiki::Query::OP_comma::new which was called 4 times, avg 37µs/call:
# 3 times (64µs+36µs) by Foswiki::Query::Parser::new at line 105 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Query/Parser.pm, avg 33µs/call
# once (32µs+18µs) by Foswiki::Query::Node::BEGIN@75 at line 79 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Query/Node.pm | ||||
19 | 8 | 83µs | my $class = shift; | ||
20 | |||||
21 | # Treated as arity 2 for parsing, but folds to n-ary | ||||
22 | 4 | 54µs | return $class->SUPER::new( # spent 54µs making 4 calls to Foswiki::Query::OP::new, avg 14µ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 | 6µs | 1; | ||
48 | __END__ |