From: Matt S Trout Date: Wed, 19 Apr 2006 23:19:13 +0000 (+0000) Subject: nuked last remaining each uses. just because. X-Git-Tag: v0.06002~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a2ca474b16783e8f1b3a199b49c4ba7afd16f503;p=dbsrgits%2FDBIx-Class.git nuked last remaining each uses. just because. --- diff --git a/lib/DBIx/Class/Row.pm b/lib/DBIx/Class/Row.pm index 9a46fe5..bcdcdbe 100644 --- a/lib/DBIx/Class/Row.pm +++ b/lib/DBIx/Class/Row.pm @@ -38,10 +38,10 @@ sub new { if ($attrs) { $new->throw_exception("attrs must be a hashref") unless ref($attrs) eq 'HASH'; - while (my ($k, $v) = each %$attrs) { + foreach my $k (keys %$attrs) { $new->throw_exception("No such column $k on $class") unless $class->has_column($k); - $new->store_column($k => $v); + $new->store_column($k => $attrs->{$k}); } } return $new; @@ -232,8 +232,8 @@ Sets more than one column value at once. sub set_columns { my ($self,$data) = @_; - while (my ($col,$val) = each %$data) { - $self->set_column($col,$val); + foreach my $col (keys %$data) { + $self->set_column($col,$data->{$col}); } return $self; }