X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FHTML%2FZoom%2FCodeStream.pm;h=0755a3b5225ae5b40ad0639812f51f474e5f7dc5;hb=b5a48c47bf8e416e5950f59543a6759fc128f38e;hp=1d70a58d6084cda5aeb5c41e33c05994dc812947;hpb=8a1c87d1e064299bf7f854cc7634b47c4c4cd407;p=catagits%2FHTML-Zoom.git diff --git a/lib/HTML/Zoom/CodeStream.pm b/lib/HTML/Zoom/CodeStream.pm index 1d70a58..0755a3b 100644 --- a/lib/HTML/Zoom/CodeStream.pm +++ b/lib/HTML/Zoom/CodeStream.pm @@ -4,29 +4,13 @@ use strict; use warnings FATAL => 'all'; use base qw(HTML::Zoom::StreamBase); -sub from_array { - my ($class, @array) = @_; - $class->new({ code => sub { - return unless @array; - return shift @array; - }}); -} - sub new { my ($class, $args) = @_; bless({ _code => $args->{code}, _zconfig => $args->{zconfig} }, $class); } -sub next { - my ($self) = @_; - - # peeked entry so return that - - if (exists $self->{_peeked}) { - return (delete $self->{_peeked}); - } - - $self->{_code}->(); +sub _next { + $_[0]->{_code}->(); } 1;