From: rkinyon Date: Wed, 22 Feb 2006 20:09:58 +0000 (+0000) Subject: exists now works on negative arrays X-Git-Tag: 0-97~24 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=feaf1e6f022f28a9d7f8dd12d5d23b38e5467139;p=dbsrgits%2FDBM-Deep.git exists now works on negative arrays --- diff --git a/lib/DBM/Deep.pm b/lib/DBM/Deep.pm index 8fd2fa3..04e5835 100644 --- a/lib/DBM/Deep.pm +++ b/lib/DBM/Deep.pm @@ -1364,7 +1364,7 @@ sub DELETE { # Delete single key/value pair or element given plain key or array index ## my $self = $_[0]->_get_self; - my $key = ($self->root->{filter_store_key} && $self->type eq TYPE_HASH) ? $self->root->{filter_store_key}->($_[1]) : $_[1]; + my $key = $_[1]; my $unpacked_key = $key; if (($self->type eq TYPE_ARRAY) && ($key =~ /^\d+$/)) { $key = pack($LONG_PACK, $key); } diff --git a/lib/DBM/Deep/Hash.pm b/lib/DBM/Deep/Hash.pm index a6a27ba..98b5d7e 100644 --- a/lib/DBM/Deep/Hash.pm +++ b/lib/DBM/Deep/Hash.pm @@ -61,6 +61,15 @@ sub EXISTS { return $self->SUPER::EXISTS( $key ); } +sub DELETE { + my $self = shift->_get_self; + my $key = ($self->root->{filter_store_key}) + ? $self->root->{filter_store_key}->($_[0]) + : $_[0]; + + return $self->SUPER::DELETE( $key ); +} + sub FIRSTKEY { ## # Locate and return first key (in no particular order)