PLIF::Service::XML::Char() was the most expensive function in a typical profile. This takes it completely off the radar by not bothering to merge adjacent strings.

This commit is contained in:
ian%hixie.ch 2001-12-04 17:51:23 +00:00
Родитель c4844719b2
Коммит 0ac4b20d8e
1 изменённых файлов: 1 добавлений и 10 удалений

Просмотреть файл

@ -185,16 +185,7 @@ sub End {
sub Char {
my $parser = shift;
my($text) = @_;
my $currentList = $parser->{'Current List'};
my $position = $#$currentList;
if (($position > 0) and ($currentList->[$position-1] eq '0')) {
# we already have some text, just stick it on the end
$currentList->[$position] .= $text;
} else {
# new text node
push(@$currentList, 0 => $text);
}
push(@{$parser->{'Current List'}}, 0 => @_);
}
sub Final {