Algorithm-SlidingWindow-Dynamic

 view release on metacpan or  search on metacpan

lib/Algorithm/SlidingWindow/Dynamic.pm  view on Meta::CPAN


our $VERSION = '0.900';

sub new {
    my ($class, %args) = @_;

    my $alloc = exists $args{alloc} ? $args{alloc} : 8;
    _check_alloc($alloc);
    $alloc = int($alloc);

    my $self = bless {
        buf  => [ (undef) x $alloc ],
        head => 0,
        size => 0,
    }, $class;

    if (exists $args{values}) {
        croak "values must be an arrayref" if ref($args{values}) ne 'ARRAY';
        $self->push(@{ $args{values} });
    }



( run in 0.662 second using v1.01-cache-2.11-cpan-39bf76dae61 )