Merge cd5303b: RT# 50541: Fix for clear bug. Introduces a speed regression
[dbsrgits/DBM-Deep.git] / lib / DBM / Deep / Array.pm
index 69be60a..a82be56 100644 (file)
@@ -396,6 +396,18 @@ sub _copy_node {
     return 1;
 }
 
+sub _clear {
+    my $self = shift;
+
+    my $size = $self->FETCHSIZE;
+    for my $key ( 0 .. $size - 1 ) {
+        $self->_engine->delete_key( $self, $key, $key );
+    }
+    $self->STORESIZE( 0 );
+
+    return;
+}
+
 ##
 # Public method aliases
 ##