[Catalyst-commits] r7976 - in Catalyst-Runtime/5.80/trunk: .
lib/Catalyst
groditi at dev.catalyst.perl.org
groditi at dev.catalyst.perl.org
Mon Jun 23 22:18:20 BST 2008
Author: groditi
Date: 2008-06-23 22:18:19 +0100 (Mon, 23 Jun 2008)
New Revision: 7976
Modified:
Catalyst-Runtime/5.80/trunk/
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm
Log:
r17536 at martha (orig r7627): matthewt | 2008-04-22 16:46:12 -0400
eliminate usage of each() on hashes we don't own, since we can't guarantee the iterator position's been reset so it's a bug waiting to happen
Property changes on: Catalyst-Runtime/5.80/trunk
___________________________________________________________________
Name: svk:merge
- 1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst/trunk/Catalyst-Runtime:9763
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/trunk:7576
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7626
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-ChildOf:4443
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-Runtime-jrockway:5857
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-component-setup:4320
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-docs:4325
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/current/Catalyst-Runtime:5142
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst:4483
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Runtime:6165
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime:8339
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime-jrockway:8342
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime:6511
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime-current:10442
+ 1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst/trunk/Catalyst-Runtime:9763
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/trunk:7576
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7627
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-ChildOf:4443
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-Runtime-jrockway:5857
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-component-setup:4320
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-docs:4325
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/current/Catalyst-Runtime:5142
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst:4483
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Runtime:6165
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime:8339
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime-jrockway:8342
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime:6511
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime-current:10442
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm 2008-06-23 21:18:09 UTC (rev 7975)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine.pm 2008-06-23 21:18:19 UTC (rev 7976)
@@ -70,8 +70,10 @@
my @cookies;
my $response = $c->response;
- while( my($name, $val) = each %{ $response->cookies } ) {
+ foreach my $name (keys %{ $response->cookies }) {
+ my $val = $response->cookies->{$name};
+
my $cookie = (
Scalar::Util::blessed($val)
? $val
@@ -293,7 +295,8 @@
my ( $self, $c ) = @_;
my $request = $c->request;
- while( my($key,$upload) = each %{ $request->uploads } ) {
+ foreach my $key (keys %{ $request->uploads }) {
+ my $upload = $request->uploads->{$key};
unlink grep { -e $_ } map { $_->tempname }
(ref $upload eq 'ARRAY' ? @{$upload} : ($upload));
}
@@ -404,12 +407,14 @@
my $body_parameters = $request->body_parameters;
my $query_parameters = $request->query_parameters;
# We copy, no references
- while( my($name, $param) = each(%$query_parameters) ) {
+ foreach my $name (keys %$query_parameters) {
+ my $param = $query_parameters->{$name};
$parameters->{$name} = ref $param eq 'ARRAY' ? [ @$param ] : $param;
}
# Merge query and body parameters
- while( my($name, $param) = each(%$body_parameters) ) {
+ foreach my $name (keys %$body_parameters) {
+ my $param = $body_parameters->{$name};
my @values = ref $param eq 'ARRAY' ? @$param : ($param);
if ( my $existing = $parameters->{$name} ) {
unshift(@values, (ref $existing eq 'ARRAY' ? @$existing : $existing));
@@ -511,7 +516,8 @@
my $uploads = $request->{_body}->upload;
my $parameters = $request->parameters;
- while(my($name,$files) = each(%$uploads) ) {
+ foreach my $name (keys %$uploads) {
+ my $files = $uploads->{$name};
my @uploads;
for my $upload (ref $files eq 'ARRAY' ? @$files : ($files)) {
my $headers = HTTP::Headers->new( %{ $upload->{headers} } );
More information about the Catalyst-commits
mailing list