X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FSchema%2FVersioned.pm;h=8aa9b6aebf23d811c2d744a605f17504b7bb2f4c;hb=52b420dd006f55aced42c669f49182890b8826ea;hp=853203b529f5205a275b1b9bfcf56643dc8ee54d;hpb=0d7d16dd7fa107999e0a89fdbd954a3a261d81e2;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Schema/Versioned.pm b/lib/DBIx/Class/Schema/Versioned.pm index 853203b..8aa9b6a 100644 --- a/lib/DBIx/Class/Schema/Versioned.pm +++ b/lib/DBIx/Class/Schema/Versioned.pm @@ -725,16 +725,9 @@ sub _source_exists { my ($self, $rs) = @_; - my $c; - my $exception; - try { - $c = $rs->search({ 1, 0 })->count; - } catch { - $exception=1; - }; - return 0 if $exception || !defined $c; + my $c = try { $rs->search({ 1, 0 })->count }; - return 1; + return (defined $c) ? 1 : 0; } 1;