X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FSybase%2FASE.pm;fp=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FSybase%2FASE.pm;h=204ce124b28adb037407c3c07cc220f5d1c23355;hb=87b1255103d7b8873b225416cb381c50011f4c06;hp=3d66fa169c343d841c949b90f610b5bfd7dedf0b;hpb=817ac9e927cd8e29d1bf553714379e54df5dbef7;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm index 3d66fa1..204ce12 100644 --- a/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm +++ b/lib/DBIx/Class/Storage/DBI/Sybase/ASE.pm @@ -11,7 +11,6 @@ use base qw/ use mro 'c3'; use DBIx::Class::Carp; use Scalar::Util qw/blessed weaken/; -use List::Util 'first'; use Sub::Name(); use Try::Tiny; use Context::Preserve 'preserve_context'; @@ -447,10 +446,10 @@ sub update { if (keys %$fields) { # Now set the identity update flags for the actual update - local $self->{_autoinc_supplied_for_op} = (first + local $self->{_autoinc_supplied_for_op} = grep { $_->{is_auto_increment} } values %{ $source->columns_info([ keys %$fields ]) } - ) ? 1 : 0; + ; my $next = $self->next::can; my $args = \@_; @@ -465,10 +464,10 @@ sub update { } else { # Set the identity update flags for the actual update - local $self->{_autoinc_supplied_for_op} = (first + local $self->{_autoinc_supplied_for_op} = grep { $_->{is_auto_increment} } values %{ $source->columns_info([ keys %$fields ]) } - ) ? 1 : 0; + ; return $self->next::method(@_); } @@ -480,17 +479,14 @@ sub _insert_bulk { my $columns_info = $source->columns_info; - my $identity_col = - first { $columns_info->{$_}{is_auto_increment} } + my ($identity_col) = + grep { $columns_info->{$_}{is_auto_increment} } keys %$columns_info; # FIXME - this is duplication from DBI.pm. When refactored towards # the LobWriter this can be folded back where it belongs. - local $self->{_autoinc_supplied_for_op} = - (first { $_ eq $identity_col } @$cols) - ? 1 - : 0 - ; + local $self->{_autoinc_supplied_for_op} + = grep { $_ eq $identity_col } @$cols; my $use_bulk_api = $self->_bulk_storage && @@ -553,7 +549,7 @@ sub _insert_bulk { my @source_columns = $source->columns; # bcp identity index is 1-based - my $identity_idx = first { $source_columns[$_] eq $identity_col } (0..$#source_columns); + my ($identity_idx) = grep { $source_columns[$_] eq $identity_col } (0..$#source_columns); $identity_idx = defined $identity_idx ? $identity_idx + 1 : 0; my @new_data;