mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02: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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user