X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FOrdered.pm;h=06e842c34e16776825d6e3f2bf20b47494b85f38;hb=632d1e0fcec8dd0b2ba1c2f9f616bf92aa22e2b3;hp=049d9c6b71d743db8d1e96f06b831b0c9b81f425;hpb=65285cf717d05229a64b45df838b7ea8fc758925;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Ordered.pm b/lib/DBIx/Class/Ordered.pm index 049d9c6..06e842c 100644 --- a/lib/DBIx/Class/Ordered.pm +++ b/lib/DBIx/Class/Ordered.pm @@ -628,11 +628,10 @@ sub update { } my @res; - my $want = wantarray(); - if (not defined $want) { + if (not defined wantarray) { $self->next::method( \%upd, @_ ); } - elsif ($want) { + elsif (wantarray) { @res = $self->next::method( \%upd, @_ ); } else { @@ -640,7 +639,7 @@ sub update { } $guard->commit; - return $want ? @res : $res[0]; + return wantarray ? @res : $res[0]; } } @@ -660,11 +659,10 @@ sub delete { $self->move_last; my @res; - my $want = wantarray(); - if (not defined $want) { + if (not defined wantarray) { $self->next::method( @_ ); } - elsif ($want) { + elsif (wantarray) { @res = $self->next::method( @_ ); } else { @@ -672,7 +670,7 @@ sub delete { } $guard->commit; - return $want ? @res : $res[0]; + return wantarray ? @res : $res[0]; } =head1 METHODS FOR EXTENDING ORDERED @@ -761,11 +759,11 @@ sub _next_position_value { Shifts all siblings with B in the range @between (inclusive) by one position as specified by $direction (left if < 0, right if > 0). By default simply increments/decrements each -L value by 1, doing so in a way as to not violate +L value by 1, doing so in a way as to not violate any existing constraints. Note that if you override this method and have unique constraints -including the L the shift is not a trivial task. +including the L the shift is not a trivial task. Refer to the implementation source of the default method for more information.