← Index
NYTProf Performance Profile   « line view »
For /usr/local/bin/sa-learn
  Run on Sun Nov 5 03:09:29 2017
Reported on Mon Nov 6 13:20:48 2017

Filename/usr/local/lib/perl5/site_perl/mach/5.24/Razor2/Preproc/deQP.pm
StatementsExecuted 1 statements in 6µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
0000s0sRazor2::Preproc::deQP::::doitRazor2::Preproc::deQP::doit
0000s0sRazor2::Preproc::deQP::::extract_qpRazor2::Preproc::deQP::extract_qp
0000s0sRazor2::Preproc::deQP::::isitRazor2::Preproc::deQP::isit
0000s0sRazor2::Preproc::deQP::::newRazor2::Preproc::deQP::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Razor2::Preproc::deQP;
2#use MIME::QuotedPrint;
3
4
5sub new {
6 return bless {}, shift;
7}
8
9
10sub isit {
11 my ($self, $text) = @_;
12 my ($hdr, $body) = split /\n\r*\n/, $$text, 2;
13 return $hdr =~ /^Content-Transfer-Encoding: quoted-printable/ism;
14}
15
16
17sub doit {
18
19 my ($self, $text) = @_;
20
21 my ($hdr, $body) = split /\n\r*\n/, $$text, 2;
22
23 # comment this out to be compatible with libpreproc.cc:qp_decode()
24 #$body =~ s/[ \t]+?(\r?\n)/$1/g; # rule #3 (trailing space must be deleted)
25 $body =~ s/=\r?\n//g; # rule #5 (soft line breaks)
26 $body =~ s/=([\da-fA-F]{2})/pack("C", hex($1))/ge;
27
28 $$text = "$hdr\n\n$body";
29
30 return $text;
31}
32
33
34sub extract_qp {
35 my ($self, $text) = @_;
36
37 if ($$text =~ /Content-Transfer-Encoding: quoted-printable(.*)$/sim) {
38 my $rhs = $1;
39 $rhs =~ /\r?\n\r?\n(.*)$/s;
40 return $1;
41 }
42 return undef;
43}
44
4516µs1;