| Filename | /usr/share/koha/lib/Koha/QueryParser/Driver/PQF/Util.pm |
| Statements | Executed 10 statements in 210µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 32µs | 87µs | Koha::QueryParser::Driver::PQF::Util::BEGIN@2 |
| 1 | 1 | 1 | 11µs | 23µs | Koha::QueryParser::Driver::PQF::Util::BEGIN@5 |
| 1 | 1 | 1 | 11µs | 14µs | Koha::QueryParser::Driver::PQF::Util::BEGIN@4 |
| 0 | 0 | 0 | 0s | 0s | Koha::QueryParser::Driver::PQF::Util::attributes_to_attr_string |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Koha::QueryParser::Driver::PQF::Util; | ||||
| 2 | 3 | 41µs | 2 | 143µs | # spent 87µs (32+55) within Koha::QueryParser::Driver::PQF::Util::BEGIN@2 which was called:
# once (32µs+55µs) by Koha::QueryParser::Driver::PQF::BEGIN@8 at line 2 # spent 87µs making 1 call to Koha::QueryParser::Driver::PQF::Util::BEGIN@2
# spent 55µs making 1 call to Exporter::import |
| 3 | |||||
| 4 | 3 | 27µs | 2 | 18µs | # spent 14µs (11+4) within Koha::QueryParser::Driver::PQF::Util::BEGIN@4 which was called:
# once (11µs+4µs) by Koha::QueryParser::Driver::PQF::BEGIN@8 at line 4 # spent 14µs making 1 call to Koha::QueryParser::Driver::PQF::Util::BEGIN@4
# spent 4µs making 1 call to strict::import |
| 5 | 3 | 139µs | 2 | 34µs | # spent 23µs (11+12) within Koha::QueryParser::Driver::PQF::Util::BEGIN@5 which was called:
# once (11µs+12µs) by Koha::QueryParser::Driver::PQF::BEGIN@8 at line 5 # spent 23µs making 1 call to Koha::QueryParser::Driver::PQF::Util::BEGIN@5
# spent 12µs making 1 call to warnings::import |
| 6 | |||||
| 7 | =head1 NAME | ||||
| 8 | |||||
| - - | |||||
| 23 | sub attributes_to_attr_string { | ||||
| 24 | my ($attributes) = @_; | ||||
| 25 | my $attr_string = ''; | ||||
| 26 | my $key; | ||||
| 27 | my $value; | ||||
| 28 | while (($key, $value) = each(%$attributes)) { | ||||
| 29 | next unless looks_like_number($key); | ||||
| 30 | $attr_string .= ' @attr ' . $key . '=' . $value . ' '; | ||||
| 31 | } | ||||
| 32 | $attr_string =~ s/^\s*//; | ||||
| 33 | $attr_string =~ s/\s*$//; | ||||
| 34 | $attr_string .= ' ' . $attributes->{''} if defined $attributes->{''}; | ||||
| 35 | return $attr_string; | ||||
| 36 | } | ||||
| 37 | |||||
| 38 | 1 | 3µs | 1; |