Filename | /var/www/foswikidev/core/lib/Foswiki/Query/OP_match.pm |
Statements | Executed 15 statements in 301µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
3 | 1 | 1 | 40µs | 112µs | new | Foswiki::Query::OP_match::
1 | 1 | 1 | 13µs | 25µs | BEGIN@11 | Foswiki::Query::OP_match::
1 | 1 | 1 | 10µs | 13µs | BEGIN@12 | Foswiki::Query::OP_match::
1 | 1 | 1 | 4µs | 4µs | BEGIN@14 | Foswiki::Query::OP_match::
1 | 1 | 1 | 4µs | 4µs | BEGIN@17 | Foswiki::Query::OP_match::
0 | 0 | 0 | 0s | 0s | __ANON__[:45] | Foswiki::Query::OP_match::
0 | 0 | 0 | 0s | 0s | evaluate | Foswiki::Query::OP_match::
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_match | ||||
6 | |||||
7 | =cut | ||||
8 | |||||
9 | package Foswiki::Query::OP_match; | ||||
10 | |||||
11 | 2 | 27µs | 2 | 37µs | # spent 25µs (13+12) within Foswiki::Query::OP_match::BEGIN@11 which was called:
# once (13µs+12µs) by Foswiki::Query::Parser::BEGIN@46 at line 11 # spent 25µs making 1 call to Foswiki::Query::OP_match::BEGIN@11
# spent 12µs making 1 call to strict::import |
12 | 2 | 23µs | 2 | 17µs | # spent 13µs (10+4) within Foswiki::Query::OP_match::BEGIN@12 which was called:
# once (10µs+4µs) by Foswiki::Query::Parser::BEGIN@46 at line 12 # spent 13µs making 1 call to Foswiki::Query::OP_match::BEGIN@12
# spent 4µs making 1 call to warnings::import |
13 | |||||
14 | 2 | 50µs | 1 | 4µs | # spent 4µs within Foswiki::Query::OP_match::BEGIN@14 which was called:
# once (4µs+0s) by Foswiki::Query::Parser::BEGIN@46 at line 14 # spent 4µs making 1 call to Foswiki::Query::OP_match::BEGIN@14 |
15 | 1 | 7µs | our @ISA = ('Foswiki::Query::ConditionalOP'); | ||
16 | |||||
17 | # spent 4µs within Foswiki::Query::OP_match::BEGIN@17 which was called:
# once (4µs+0s) by Foswiki::Query::Parser::BEGIN@46 at line 22 | ||||
18 | 1 | 7µs | if ( $Foswiki::cfg{UseLocale} ) { | ||
19 | require locale; | ||||
20 | import locale(); | ||||
21 | } | ||||
22 | 1 | 148µs | 1 | 4µs | } # spent 4µs making 1 call to Foswiki::Query::OP_match::BEGIN@17 |
23 | |||||
24 | # spent 112µs (40+71) within Foswiki::Query::OP_match::new which was called 3 times, avg 37µs/call:
# 3 times (40µs+71µs) by Foswiki::Query::Parser::new at line 112 of /var/www/foswikidev/core/lib/Foswiki/Query/Parser.pm, avg 37µs/call | ||||
25 | 3 | 2µs | my $class = shift; | ||
26 | 3 | 37µs | 3 | 71µs | return $class->SUPER::new( name => '=~', prec => 500 ); # spent 71µs making 3 calls to Foswiki::Query::ConditionalOP::new, avg 24µs/call |
27 | } | ||||
28 | |||||
29 | sub evaluate { | ||||
30 | my $this = shift; | ||||
31 | my $node = shift; | ||||
32 | |||||
33 | return $this->evalTest( | ||||
34 | $node, | ||||
35 | \@_, | ||||
36 | sub { | ||||
37 | my $regex; | ||||
38 | eval { $regex = qr/$_[1]/ }; | ||||
39 | if ($@) { | ||||
40 | throw Foswiki::Infix::Error("Bad regular expression '$_[1]'"); | ||||
41 | } | ||||
42 | defined( $_[0] ) | ||||
43 | && defined( $_[1] ) | ||||
44 | && $_[0] =~ m/$regex/s ? 1 : 0; | ||||
45 | } | ||||
46 | ); | ||||
47 | } | ||||
48 | |||||
49 | 1 | 3µs | 1; | ||
50 | __END__ |