| 1 | package Mojo::Collection::XS; | ||
| 2 | use Mojo::Base 'Mojo::Collection'; | ||
| 3 | |||
| 4 | our $VERSION = '0.2'; | ||
| 5 | |||
| 6 | use XSLoader; | ||
| 7 | XSLoader::load(__PACKAGE__, $VERSION); | ||
| 8 | |||
| 9 | our @EXPORT_OK = ('c'); | ||
| 10 | |||
| 11 | # Optional constructor helper | ||
| 12 | sub c { __PACKAGE__->new(@_) } | ||
| 13 | |||
| 14 | sub new { | ||
| 15 | my $class = shift; | ||
| 16 | return bless [@_], ref $class || $class; | ||
| 17 | } | ||
| 18 | |||
| 19 | sub while_fast { my ($self, $cb) = @_; Mojo::Collection::XS::while_fast($self, $cb); } | ||
| 20 | sub while_ultra { my ($self, $cb) = @_; Mojo::Collection::XS::while_ultra($self, $cb); } | ||
| 21 | sub each_fast { my ($self, $cb) = @_; Mojo::Collection::XS::each_fast($self, $cb); } | ||
| 22 | sub map_fast { my ($self, $cb) = @_; Mojo::Collection::XS::map_fast($self, $cb); } | ||
| 23 | sub map_ultra { my ($self, $cb) = @_; Mojo::Collection::XS::map_ultra($self, $cb); } | ||
| 24 | sub grep_fast { my ($self, $cb) = @_; Mojo::Collection::XS::grep_fast($self, $cb); } | ||
| 25 | |||
| 26 | 1; | ||
| 27 | |||
| 28 | __END__ |