tiny speedup decoding + in DecodeURI()
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 31 Mar 2007 02:08:21 +0000 (04:08 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 31 Mar 2007 02:08:21 +0000 (04:08 +0200)
PLP/Functions.pm

index fe1f39c145d22bf5034f9135f51d7acd1caccaaa..3eb07cacef913d6080d49eb81ca3aa5586e6fbde 100644 (file)
@@ -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;
                };
        }