Skip to content

Commit

Permalink
try to reuse slurp
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 5, 2017
1 parent 62d0440 commit 61e53e4
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/Mojo/Asset/File.pm
Expand Up @@ -111,13 +111,7 @@ sub mtime { (stat shift->handle)[9] }

sub size { -s shift->handle }

sub slurp {
my $handle = shift->handle;
$handle->sysseek(0, SEEK_SET);
defined $handle->sysread(my $content, -s $handle, 0)
or croak qq{Can't read from asset: $!};
return $content;
}
sub slurp { Mojo::File->new(shift->path)->slurp }

1;

Expand Down

0 comments on commit 61e53e4

Please sign in to comment.