From: Shawn M Moore Date: Sat, 17 May 2008 09:23:15 +0000 (+0000) Subject: The empty provided methods are returning the wrong values! X-Git-Tag: 0.18_01~40 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=369675376487f7dedfed167eed594a65ea82e9b1;p=gitmo%2FMooseX-AttributeHelpers.git The empty provided methods are returning the wrong values! --- diff --git a/lib/MooseX/AttributeHelpers/MethodProvider/ImmutableHash.pm b/lib/MooseX/AttributeHelpers/MethodProvider/ImmutableHash.pm index 1cf5123..b3825cc 100644 --- a/lib/MooseX/AttributeHelpers/MethodProvider/ImmutableHash.pm +++ b/lib/MooseX/AttributeHelpers/MethodProvider/ImmutableHash.pm @@ -48,7 +48,7 @@ sub count : method { sub empty : method { my ($attr, $reader, $writer) = @_; - return sub { scalar CORE::keys %{$reader->($_[0])} ? 1 : 0 }; + return sub { scalar CORE::keys %{$reader->($_[0])} ? 0 : 1 }; } 1; diff --git a/lib/MooseX/AttributeHelpers/MethodProvider/List.pm b/lib/MooseX/AttributeHelpers/MethodProvider/List.pm index 7e3c6cb..a47cbe2 100644 --- a/lib/MooseX/AttributeHelpers/MethodProvider/List.pm +++ b/lib/MooseX/AttributeHelpers/MethodProvider/List.pm @@ -14,7 +14,7 @@ sub count : method { sub empty : method { my ($attr, $reader, $writer) = @_; return sub { - scalar @{$reader->($_[0])} ? 1 : 0 + scalar @{$reader->($_[0])} ? 0 : 1 }; }