From: rkinyon Date: Tue, 28 Feb 2006 19:23:41 +0000 (+0000) Subject: Removed file-is-open gatekeeper checks ... no tests for them X-Git-Tag: 0-99_01~117 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ecfc6cdb9a56b5f20c76a10df9493578ac0c1abf;p=dbsrgits%2FDBM-Deep.git Removed file-is-open gatekeeper checks ... no tests for them --- diff --git a/lib/DBM/Deep.pm b/lib/DBM/Deep.pm index c79fbfd..3dcbc19 100644 --- a/lib/DBM/Deep.pm +++ b/lib/DBM/Deep.pm @@ -1287,13 +1287,6 @@ sub STORE { my $md5 = $DIGEST_FUNC->($key); - ## - # Make sure file is open - ## -# if (!defined($self->_fh) && !$self->_open()) { -# return; -# } - unless ( _is_writable( $self->_fh ) ) { $self->_throw_error( 'Cannot write to a readonly filehandle' ); } @@ -1357,11 +1350,6 @@ sub FETCH { my $self = shift->_get_self; my $key = shift; - ## - # Make sure file is open - ## -# if (!defined($self->_fh)) { $self->_open(); } - my $md5 = $DIGEST_FUNC->($key); ## @@ -1400,11 +1388,6 @@ sub DELETE { my $md5 = $DIGEST_FUNC->($key); ## - # Make sure file is open - ## -# if (!defined($self->_fh)) { $self->_open(); } - - ## # Request exclusive lock for writing ## $self->lock( LOCK_EX ); @@ -1445,11 +1428,6 @@ sub EXISTS { my $md5 = $DIGEST_FUNC->($key); ## - # Make sure file is open - ## -# if (!defined($self->_fh)) { $self->_open(); } - - ## # Request shared lock for reading ## $self->lock( LOCK_SH ); @@ -1481,11 +1459,6 @@ sub CLEAR { my $self = $_[0]->_get_self; ## - # Make sure file is open - ## -# if (!defined($self->_fh)) { $self->_open(); } - - ## # Request exclusive lock for writing ## $self->lock( LOCK_EX ); diff --git a/lib/DBM/Deep/Hash.pm b/lib/DBM/Deep/Hash.pm index 9dcc7ec..778c7cc 100644 --- a/lib/DBM/Deep/Hash.pm +++ b/lib/DBM/Deep/Hash.pm @@ -64,11 +64,6 @@ sub FIRSTKEY { my $self = $_[0]->_get_self; ## - # Make sure file is open - ## -# if (!defined($self->_fh)) { $self->_open(); } - - ## # Request shared lock for reading ## $self->lock( $self->LOCK_SH ); @@ -95,11 +90,6 @@ sub NEXTKEY { my $prev_md5 = $DBM::Deep::DIGEST_FUNC->($prev_key); ## - # Make sure file is open - ## -# if (!defined($self->_fh)) { $self->_open(); } - - ## # Request shared lock for reading ## $self->lock( $self->LOCK_SH );