From: Brian Cassidy Date: Tue, 13 Nov 2007 18:19:08 +0000 (+0000) Subject: only check if a plugin is supported once we're sure we want to use it. this will... X-Git-Tag: v0.09_01~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ade8c46e9b5c63a262f6db99c9a0d703695912b0;p=p5sagit%2FConfig-Any.git only check if a plugin is supported once we're sure we want to use it. this will save us from loading modules we don't need to. --- diff --git a/lib/Config/Any.pm b/lib/Config/Any.pm index 1f172bc..55cf4c3 100644 --- a/lib/Config/Any.pm +++ b/lib/Config/Any.pm @@ -141,8 +141,7 @@ sub _load { } # figure out what plugins we're using - my @plugins = grep { $_->is_supported } - ( $force ? @{ $args->{ force_plugins } } : $class->plugins ); + my @plugins = $force ? @{ $args->{ force_plugins } } : $class->plugins; # map extensions if we have to my ( %extension_lut, $extension_re ); @@ -179,6 +178,7 @@ sub _load { } for my $loader ( @try_plugins ) { + next unless $loader->is_supported; my @configs = eval { $loader->load( $filename, $loader_args{ $loader } ); };