From: rkinyon Date: Sun, 7 Jan 2007 05:22:06 +0000 (+0000) Subject: Keys now works X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9ce79856b16d3aace0d15f581f0a34016a094e6e;p=dbsrgits%2FDBM-Deep.git Keys now works --- diff --git a/lib/DBM/Deep/Engine3.pm b/lib/DBM/Deep/Engine3.pm index a3cae4c..84a1b0a 100644 --- a/lib/DBM/Deep/Engine3.pm +++ b/lib/DBM/Deep/Engine3.pm @@ -878,7 +878,14 @@ sub get_next_key { return if $self->at_end; - my $key_sector = $self->{sector}->get_key_for( $self->{curr_index}++ ); + my $data_loc = $self->{sector}->get_data_location_for({ + allow_head => 1, + idx => $self->{curr_index}++, + }) or return; + + my $key_sector = $self->{sector}->get_key_for( $self->{curr_index} - 1 ); + + #XXX Is this check necessary now? return unless $key_sector; return $key_sector->data; diff --git a/t/03_bighash.t b/t/03_bighash.t index b292c0d..af54164 100644 --- a/t/03_bighash.t +++ b/t/03_bighash.t @@ -40,8 +40,8 @@ for ( 0 .. $max_keys ) { } is( $count, $max_keys, "We read $count keys" ); -SKIP: { - skip "Keys aren't ready yet", 3; +#SKIP: { +#skip "Keys aren't ready yet", 3; my @keys = sort keys %$db; cmp_ok( scalar(@keys), '==', $max_keys + 1, "Number of keys is correct" ); my @control = sort map { "hello $_" } 0 .. $max_keys; @@ -49,4 +49,4 @@ cmp_deeply( \@keys, \@control, "Correct keys are there" ); $db->clear; cmp_ok( scalar(keys %$db), '==', 0, "Number of keys after clear() is correct" ); -} +#}