mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
Appending to the string is faster than copying it. Additionally, str_repeat is optimized for strings like "\0". This issue only came up with really, really large files to compress ( 150 MB + !)
git-svn-id: file:///svn/phpbb/trunk@5578 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
718a2bf4cd
commit
835c9835d0
1 changed files with 1 additions and 1 deletions
|
@ -527,7 +527,7 @@ class compress_tar extends compress
|
|||
|
||||
if ($stat[7] !== 0 && !$is_dir)
|
||||
{
|
||||
$fzwrite($this->fp, pack('a'.($stat[7] + 512 - $stat[7] % 512), $data));
|
||||
$fzwrite($this->fp, $data . (($stat[7] % 512 > 0) ? str_repeat("\0", 512 - $stat[7] % 512) : ''));
|
||||
unset($data);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue