From: Dagfinn Ilmari Mannsåker Date: Sun, 21 Jul 2013 12:20:11 +0000 (+0100) Subject: Avoid conditional assignment in variable declarations X-Git-Tag: 0.07036_01~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6e12b744d031d3c9517ce9f3e4ad5f12b9b6cfbb;p=dbsrgits%2FDBIx-Class-Schema-Loader.git Avoid conditional assignment in variable declarations any() already returns a boolean, just assign it directly --- diff --git a/lib/DBIx/Class/Schema/Loader/Base.pm b/lib/DBIx/Class/Schema/Loader/Base.pm index b731ed8..a133812 100644 --- a/lib/DBIx/Class/Schema/Loader/Base.pm +++ b/lib/DBIx/Class/Schema/Loader/Base.pm @@ -1605,8 +1605,8 @@ sub _load_tables { my $moniker_parts = [ @{ $self->moniker_parts } ]; - my $have_schema = 1 if any { $_ eq 'schema' } @{ $self->moniker_parts }; - my $have_database = 1 if any { $_ eq 'database' } @{ $self->moniker_parts }; + my $have_schema = any { $_ eq 'schema' } @{ $self->moniker_parts }; + my $have_database = any { $_ eq 'database' } @{ $self->moniker_parts }; unshift @$moniker_parts, 'schema' if $use_schema && !$have_schema; unshift @$moniker_parts, 'database' if $use_database && !$have_database;