This results in over 1% speedup doing $MESSAGE_ID/T/ HTML
generation for a 368-message thread.
(?:\#[a-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@/%\?]+)?
)}xi;
(?:\#[a-z0-9\-\._~!\$\&\';\(\)\*\+,;=:@/%\?]+)?
)}xi;
-sub new { bless {}, shift }
+sub new { bless {}, $_[0] }
- my ($self, $s) = @_;
- $s =~ s!$LINK_RE!
my $beg = $1 || '';
my $url = $2;
my $end = '';
my $beg = $1 || '';
my $url = $2;
my $end = '';
# only escape ampersands, others do not match LINK_RE
$url =~ s/&/&/g;
# only escape ampersands, others do not match LINK_RE
$url =~ s/&/&/g;
$beg . 'PI-LINK-'. $key . $end;
!ge;
$beg . 'PI-LINK-'. $key . $end;
!ge;
# Added "PI-LINK-" prefix to avoid false-positives on git commits
# Added "PI-LINK-" prefix to avoid false-positives on git commits
- $s =~ s!\bPI-LINK-([a-f0-9]{40})\b!
+ $_[1] =~ s!\bPI-LINK-([a-f0-9]{40})\b!
- my $url = $self->{$key};
+ my $url = $_[0]->{$key};
if (defined $url) {
"<a\nhref=\"$url\">$url</a>";
} else {
if (defined $url) {
"<a\nhref=\"$url\">$url</a>";
} else {
flush_quote(\$s, $l, \@quot) if @quot;
# regular line, OK
flush_quote(\$s, $l, \@quot) if @quot;
# regular line, OK
- $cur = $l->linkify_1($cur);
- $cur = ascii_html($cur);
- $s .= $l->linkify_2($cur);
+ $l->linkify_1($cur);
+ $s .= $l->linkify_2(ascii_html($cur));
} else {
push @quot, $cur;
}
} else {
push @quot, $cur;
}