Skip to content

Commit

Permalink
length is not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 21, 2015
1 parent 9ac2e10 commit 8cd6fa7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/Mojo/Asset/File.pm
Expand Up @@ -46,8 +46,7 @@ sub DESTROY {

sub add_chunk {
my ($self, $chunk) = @_;
$chunk //= '';
defined $self->handle->syswrite($chunk, length $chunk)
defined $self->handle->syswrite($chunk // '')
or croak "Can't write to asset: $!";
return $self;
}
Expand Down
5 changes: 3 additions & 2 deletions lib/Mojo/Util.pm
Expand Up @@ -244,8 +244,9 @@ sub split_header { _header(shift, 0) }

sub spurt {
my ($content, $path) = @_;
open my $file, '>:unix', $path or croak qq{Can't open file "$path": $!};
print $file $content or croak qq{Can't write to file "$path": $!};
open my $file, '>', $path or croak qq{Can't open file "$path": $!};
defined $file->syswrite($content)
or croak qq{Can't write to file "$path": $!};
return $content;
}

Expand Down

0 comments on commit 8cd6fa7

Please sign in to comment.