Permalink
Browse files

simplified HashStore helper

  • Loading branch information...
1 parent 98b100f commit 9c169aa3004a4534046d171b8ddcc800a25e2098 @jberger committed Nov 16, 2012
Showing with 2 additions and 4 deletions.
  1. +2 −4 lib/Moodule/Build/Base.pm
@@ -7,7 +7,7 @@ use Moodule::Build::HashStore;
sub HashStore {
my $name = shift or croak "Must specify the name of the HashStore";
- my ($default) = @_;
+ my $default = @_ ? shift : {};
if ($default && ref $default ne 'HASH') {
croak "HashStore default must be a hash reference";
}
@@ -21,9 +21,7 @@ sub HashStore {
return $_[0] if eval{ $_[0]->isa('Moodule::Build::HashStore') };
return Moodule::Build::HashStore->new( data => $_[0] );
},
- default => $default
- ? sub { Moodule::Build::HashStore->new( data => $default ) }
- : sub { Moodule::Build::HashStore->new },
+ default => sub { Moodule::Build::HashStore->new( data => $default ) },
);
}

0 comments on commit 9c169aa

Please sign in to comment.