Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed typo
  • Loading branch information
kraih committed Feb 13, 2013
1 parent d277d66 commit 4d24b67
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,4 +1,7 @@

3.86 2013-02-14
- Improved documentation.

3.85 2013-02-13
- Deprecated Mojo::UserAgent->build_form_tx in favor of
Mojo::UserAgent->build_tx.
Expand Down
10 changes: 5 additions & 5 deletions lib/Mojo/Asset/File.pm
Expand Up @@ -92,15 +92,15 @@ sub contains {
}

sub get_chunk {
my ($self, $start) = @_;
my ($self, $offset) = @_;

$start += $self->start_range;
$offset += $self->start_range;
my $handle = $self->handle;
$handle->sysseek($start, SEEK_SET);
$handle->sysseek($offset, SEEK_SET);

my $buffer;
if (defined(my $end = $self->end_range)) {
my $chunk = $end + 1 - $start;
my $chunk = $end + 1 - $offset;
return '' if $chunk <= 0;
$handle->sysread($buffer, $chunk > 131072 ? 131072 : $chunk);
}
Expand Down Expand Up @@ -220,7 +220,7 @@ Check if asset contains a specific string.
=head2 get_chunk
my $bytes = $file->get_chunk($start);
my $bytes = $file->get_chunk($offset);
Get chunk of data starting from a specific position.
Expand Down
8 changes: 4 additions & 4 deletions lib/Mojo/Asset/Memory.pm
Expand Up @@ -32,15 +32,15 @@ sub contains {
}

sub get_chunk {
my ($self, $start) = @_;
my ($self, $offset) = @_;

$start += $self->start_range;
$offset += $self->start_range;
my $size = 131072;
if (my $end = $self->end_range) {
$size = $end + 1 - $start if ($start + $size) > $end;
$size = $end + 1 - $offset if ($offset + $size) > $end;
}

return substr shift->{content}, $start, $size;
return substr shift->{content}, $offset, $size;
}

sub move_to {
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -40,7 +40,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Rainbow';
our $VERSION = '3.85';
our $VERSION = '3.86';

sub AUTOLOAD {
my $self = shift;
Expand Down

0 comments on commit 4d24b67

Please sign in to comment.