From: sprout Date: Fri, 29 Jan 2010 21:51:55 +0000 (-0800) Subject: Remove temporary workaround for clear() and "0" key bug X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5a7551626dffba6d13e64059529675ab944372cf;p=dbsrgits%2FDBM-Deep.git Remove temporary workaround for clear() and "0" key bug --- diff --git a/lib/DBM/Deep/Hash.pm b/lib/DBM/Deep/Hash.pm index e3188ec..45dc3ff 100644 --- a/lib/DBM/Deep/Hash.pm +++ b/lib/DBM/Deep/Hash.pm @@ -114,7 +114,7 @@ sub next_key { (shift)->NEXTKEY(@_) } sub _clear { my $self = shift; - while ( my $key = $self->first_key ) { + while ( defined(my $key = $self->first_key) ) { $self->_engine->delete_key( $self, $key, $key ); } diff --git a/t/02_hash.t b/t/02_hash.t index 6fd66d8..c6646c1 100644 --- a/t/02_hash.t +++ b/t/02_hash.t @@ -97,9 +97,6 @@ is( scalar keys %$db, 1, "After deleting two keys, 1 remains" ); ## ok( $db->clear(), "clear() returns true" ); -# ~~~ Temporary band-aid until the fix for RT#50541 is merged -delete $db->{0}; - is( scalar keys %$db, 0, "After clear(), everything is removed" ); ##