Bugfix: wrong handling of large number of raft layers. #2041

This commit is contained in:
Alessandro Ranellucci 2014-05-25 23:17:00 +02:00
parent a62457d6b5
commit 4e5f7d74ff
2 changed files with 7 additions and 8 deletions

View file

@ -308,11 +308,10 @@ sub slice {
}
# remove empty layers from bottom
my $first_object_layer_id = $self->config->raft_layers;
while (@{$self->layers} && !@{$self->layers->[$first_object_layer_id]->slices}) {
splice @{$self->layers}, $first_object_layer_id, 1;
for (my $i = $first_object_layer_id; $i <= $#{$self->layers}; $i++) {
$self->layers->[$i]->id($i);
while (@{$self->layers} && !@{$self->layers->[0]->slices}) {
shift @{$self->layers};
for (my $i = 0; $i <= $#{$self->layers}; $i++) {
$self->layers->[$i]->id( $self->layers->[$i]->id-1 );
}
}