From: David Precious Date: Wed, 9 Mar 2016 10:31:42 +0000 (+0000) Subject: No need for the intermediate copy. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c9d69ced9c82f7b5ef9d7aaef492dca37c660ecd;p=catagits%2FHTTP-Body.git No need for the intermediate copy. I had thought I needed to copy it first so the changes that the following code make to the buffer won't be made to the raw body copy, but I'm not passing it by reference to io_from_any() so it's already a copy, no need for two! --- diff --git a/lib/HTTP/Body/UrlEncoded.pm b/lib/HTTP/Body/UrlEncoded.pm index 3f45965..2a012ac 100644 --- a/lib/HTTP/Body/UrlEncoded.pm +++ b/lib/HTTP/Body/UrlEncoded.pm @@ -41,8 +41,7 @@ sub spin { # Store a copy of the raw request that the body() method can return # see RT #111876 - my $body_content = $self->{buffer}; - $self->body(IO::Handle::Util::io_from_any($body_content)); + $self->body(IO::Handle::Util::io_from_any($self->{buffer})); # I tested parsing this using APR::Request, but perl is faster # Pure-Perl 2560/s