diff options
author | Brian Cassidy <bricas@cpan.org> | 2011-12-08 11:43:29 -0400 |
---|---|---|
committer | Brian Cassidy <bricas@cpan.org> | 2011-12-08 11:43:29 -0400 |
commit | 0977df2d6922eb02c36fa057ccc52ae554e858e8 (patch) | |
tree | 677c8ce4329a3beaeaafe14d803d4d469ae25f8d | |
parent | fix warnings in test (diff) | |
download | net-http-spore-0977df2d6922eb02c36fa057ccc52ae554e858e8.tar.gz |
remove unused var; simplify conditions
-rw-r--r-- | lib/Net/HTTP/Spore.pm | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/lib/Net/HTTP/Spore.pm b/lib/Net/HTTP/Spore.pm index 87454c9..356d376 100644 --- a/lib/Net/HTTP/Spore.pm +++ b/lib/Net/HTTP/Spore.pm @@ -88,13 +88,8 @@ sub _attach_spec_to_class { }; try { - my $base_url; - if ( $spec->{base_url} && !$opts->{base_url} ) { - $opts->{base_url} = $spec->{base_url}; - } - elsif ( !$opts->{base_url} ) { - die "base_url is missing!"; - } + $opts->{base_url} ||= $spec->{base_url}; + die "base_url is missing!" if !$opts->{base_url}; if ( $spec->{formats} ) { $opts->{formats} = $spec->{formats}; |