=cut
sub next_storage {
- return (shuffle(shift->pool->active_replicants))[0];
+ my $self = shift @_;
+ my @active_replicants = $self->pool->active_replicants;
+ my $count_active_replicants = $#active_replicants +1;
+
+ return $active_replicants[int(rand($count_active_replicants +1))];
}
=head1 AUTHOR
=cut
+__PACKAGE__->meta->make_immutable;
+
1;
\ No newline at end of file