Filename | /usr/local/src/github.com/foswiki/core/lib/Foswiki/Macros/ADDTOHEAD.pm |
Statements | Executed 15 statements in 463µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 54µs | 76µs | BEGIN@5.49 | Foswiki::
1 | 1 | 1 | 30µs | 38µs | BEGIN@4.48 | Foswiki::
1 | 1 | 1 | 27µs | 88µs | ADDTOHEAD | Foswiki::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | # See bottom of file for license and copyright information | ||||
2 | package Foswiki; | ||||
3 | |||||
4 | 2 | 52µs | 2 | 47µs | # spent 38µs (30+9) within Foswiki::BEGIN@4.48 which was called:
# once (30µs+9µs) by Foswiki::_expandMacroOnTopicRendering at line 4 # spent 38µs making 1 call to Foswiki::BEGIN@4.48
# spent 9µs making 1 call to strict::import |
5 | 2 | 377µs | 2 | 97µs | # spent 76µs (54+21) within Foswiki::BEGIN@5.49 which was called:
# once (54µs+21µs) by Foswiki::_expandMacroOnTopicRendering at line 5 # spent 76µs making 1 call to Foswiki::BEGIN@5.49
# spent 21µs making 1 call to warnings::import |
6 | |||||
7 | # spent 88µs (27+61) within Foswiki::ADDTOHEAD which was called:
# once (27µs+61µs) by Foswiki::_expandMacroOnTopicRendering at line 3066 of /usr/local/src/github.com/foswiki/core/lib/Foswiki.pm | ||||
8 | 10 | 29µs | my ( $this, $args, $topicObject ) = @_; | ||
9 | |||||
10 | my $_DEFAULT = $args->{_DEFAULT}; | ||||
11 | my $text = $args->{text}; | ||||
12 | my $topic = $args->{topic}; | ||||
13 | my $requires = $args->{requires}; | ||||
14 | if ( defined $args->{topic} ) { | ||||
15 | my ( $web, $topic ) = | ||||
16 | $this->normalizeWebTopicName( $topicObject->web, $args->{topic} ); | ||||
17 | |||||
18 | # prevent deep recursion | ||||
19 | $web =~ s/\//\./g; # SMELL: unnecessary? | ||||
20 | unless ( $this->{_addedToHEAD}{"$web.$topic"} ) { | ||||
21 | my $atom = Foswiki::Meta->load( $this, $web, $topic ); | ||||
22 | $text = $atom->text(); | ||||
23 | $this->{_addedToHEAD}{"$web.$topic"} = 1; | ||||
24 | } | ||||
25 | } | ||||
26 | $text = $_DEFAULT unless defined $text; | ||||
27 | $text = '' unless defined $text; | ||||
28 | |||||
29 | 1 | 61µs | $this->addToZone( 'head', $_DEFAULT, $text, $requires ); # spent 61µs making 1 call to Foswiki::addToZone | ||
30 | return ''; | ||||
31 | } | ||||
32 | |||||
33 | 1 | 5µs | 1; | ||
34 | __END__ |