From: Mischa POSLAWSKY Date: Sat, 31 Mar 2007 02:08:21 +0000 (+0200) Subject: tiny speedup decoding + in DecodeURI() X-Git-Tag: 3.20~40 X-Git-Url: http://git.shiar.nl/perl/plp/.git/commitdiff_plain/b76b015b41c31d18044c5f95b4416329ba1507db tiny speedup decoding + in DecodeURI() --- diff --git a/PLP/Functions.pm b/PLP/Functions.pm index fe1f39c..3eb07ca 100644 --- a/PLP/Functions.pm +++ b/PLP/Functions.pm @@ -52,8 +52,8 @@ sub DecodeURI (@) { my $ref = defined wantarray ? [@_] : \@_; for (@$ref) { eval { - s/\+/%20/g; # Browsers do y/ /+/ - I don't care about RFC's, but - # I do care about real-life situations. + tr/+/ /; # Browsers do tr/ /+/ - I don't care about RFCs, but + # I do care about real-life situations. s/%([0-9A-Fa-f][0-9A-Fa-f])/chr hex $1/ge; }; }