diff options
author | David M <davidmj@users.sourceforge.net> | 2006-02-23 23:54:34 +0000 |
---|---|---|
committer | David M <davidmj@users.sourceforge.net> | 2006-02-23 23:54:34 +0000 |
commit | 835c9835d0c700f6eb75e186e9fa38041a1b2693 (patch) | |
tree | 1efef51d83018d5fbe579811d3d18d6a4e4f7650 /phpBB/includes/functions_compress.php | |
parent | 718a2bf4cd102d99a6413fc3210b753a5d098dfb (diff) | |
download | forums-835c9835d0c700f6eb75e186e9fa38041a1b2693.tar forums-835c9835d0c700f6eb75e186e9fa38041a1b2693.tar.gz forums-835c9835d0c700f6eb75e186e9fa38041a1b2693.tar.bz2 forums-835c9835d0c700f6eb75e186e9fa38041a1b2693.tar.xz forums-835c9835d0c700f6eb75e186e9fa38041a1b2693.zip |
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
Diffstat (limited to 'phpBB/includes/functions_compress.php')
-rw-r--r-- | phpBB/includes/functions_compress.php | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/phpBB/includes/functions_compress.php b/phpBB/includes/functions_compress.php index 165de43e0c..31627d29a1 100644 --- a/phpBB/includes/functions_compress.php +++ b/phpBB/includes/functions_compress.php @@ -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); } } |