Filename | /usr/local/src/github.com/foswiki/core/lib/Foswiki/Contrib/MailerContrib/UpData.pm |
Statements | Executed 11 statements in 394µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
2 | 1 | 1 | 54µs | 54µs | new | Foswiki::Contrib::MailerContrib::UpData::
1 | 1 | 1 | 31µs | 39µs | BEGIN@13 | Foswiki::Contrib::MailerContrib::UpData::
1 | 1 | 1 | 17µs | 35µs | BEGIN@14 | Foswiki::Contrib::MailerContrib::UpData::
0 | 0 | 0 | 0s | 0s | getParent | Foswiki::Contrib::MailerContrib::UpData::
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::Contrib::MailerContrib::UpData | ||||
6 | Object that lazy-scans topics to extract | ||||
7 | parent relationships. | ||||
8 | |||||
9 | =cut | ||||
10 | |||||
11 | package Foswiki::Contrib::MailerContrib::UpData; | ||||
12 | |||||
13 | 2 | 53µs | 2 | 46µs | # spent 39µs (31+7) within Foswiki::Contrib::MailerContrib::UpData::BEGIN@13 which was called:
# once (31µs+7µs) by Foswiki::Contrib::MailerContrib::BEGIN@27 at line 13 # spent 39µs making 1 call to Foswiki::Contrib::MailerContrib::UpData::BEGIN@13
# spent 7µs making 1 call to strict::import |
14 | 2 | 279µs | 2 | 53µs | # spent 35µs (17+18) within Foswiki::Contrib::MailerContrib::UpData::BEGIN@14 which was called:
# once (17µs+18µs) by Foswiki::Contrib::MailerContrib::BEGIN@27 at line 14 # spent 35µs making 1 call to Foswiki::Contrib::MailerContrib::UpData::BEGIN@14
# spent 18µs making 1 call to warnings::import |
15 | |||||
16 | =begin TML | ||||
17 | |||||
18 | ---++ new($web) | ||||
19 | * =$web= - Web we are building parent relationships for | ||||
20 | Constructor for a web; initially empty, will lazy-load as topics | ||||
21 | are referenced. | ||||
22 | |||||
23 | =cut | ||||
24 | |||||
25 | # spent 54µs within Foswiki::Contrib::MailerContrib::UpData::new which was called 2 times, avg 27µs/call:
# 2 times (54µs+0s) by Foswiki::Contrib::MailerContrib::_isSubscribedToTopic at line 165 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Contrib/MailerContrib.pm, avg 27µs/call | ||||
26 | 6 | 58µs | my ( $class, $web ) = @_; | ||
27 | my $this = bless( { web => $web }, $class ); | ||||
28 | |||||
29 | return $this; | ||||
30 | } | ||||
31 | |||||
32 | =begin TML | ||||
33 | |||||
34 | ---++ getParent($topic) -> string | ||||
35 | Get the name of the parent topic of the given topic | ||||
36 | |||||
37 | =cut | ||||
38 | |||||
39 | sub getParent { | ||||
40 | my ( $this, $topic ) = @_; | ||||
41 | |||||
42 | if ( !defined( $this->{parent}{$topic} ) ) { | ||||
43 | my ( $meta, $text ) = Foswiki::Func::readTopic( $this->{web}, $topic ); | ||||
44 | my $parent = $meta->get('TOPICPARENT'); | ||||
45 | $this->{parent}{$topic} = $parent->{name} if $parent; | ||||
46 | $this->{parent}{$topic} ||= ''; | ||||
47 | } | ||||
48 | |||||
49 | return $this->{parent}{$topic}; | ||||
50 | } | ||||
51 | |||||
52 | 1 | 4µs | 1; | ||
53 | __END__ |