mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Zip - speed up .zip creation
This commit is contained in:
parent
1ee04fc7c1
commit
0bed1bda2d
1 changed files with 6 additions and 11 deletions
|
|
@ -48,12 +48,6 @@ uses
|
|||
implementation
|
||||
|
||||
uses
|
||||
{$IFDEF MSWINDOWS}
|
||||
Windows,
|
||||
{$ENDIF}
|
||||
{$IFDEF LibcAPI}
|
||||
Libc,
|
||||
{$ENDIF}
|
||||
SysUtils,
|
||||
AbArcTyp,
|
||||
AbExcept,
|
||||
|
|
@ -63,6 +57,7 @@ uses
|
|||
AbDfBase,
|
||||
AbZlibPrc,
|
||||
AbZipxPrc,
|
||||
DCcrc32,
|
||||
DCClassesUtf8;
|
||||
|
||||
|
||||
|
|
@ -127,19 +122,19 @@ end;
|
|||
{ ========================================================================== }
|
||||
procedure DoStore(Archive : TAbZipArchive; Item : TAbZipItem; OutStream, InStream : TStream);
|
||||
var
|
||||
CRC32 : LongInt;
|
||||
CRC32 : UInt32;
|
||||
Percent : LongInt;
|
||||
LastPercent : LongInt;
|
||||
InSize : Int64;
|
||||
DataRead : Int64;
|
||||
Total : Int64;
|
||||
Abort : Boolean;
|
||||
Buffer : array [0..8191] of byte;
|
||||
Buffer : array [0..16383] of byte;
|
||||
begin
|
||||
{ setup }
|
||||
Item.CompressionMethod := cmStored;
|
||||
Abort := False;
|
||||
CRC32 := -1;
|
||||
CRC32 := 0;
|
||||
Total := 0;
|
||||
Percent := 0;
|
||||
LastPercent := 0;
|
||||
|
|
@ -159,7 +154,7 @@ begin
|
|||
end;
|
||||
|
||||
{ update CRC}
|
||||
AbUpdateCRCBuffer(CRC32, Buffer, DataRead);
|
||||
CRC32 := crc32_16bytes(Buffer, DataRead, CRC32);
|
||||
|
||||
{ write data (encrypting if needed) }
|
||||
OutStream.WriteBuffer(Buffer, DataRead);
|
||||
|
|
@ -169,7 +164,7 @@ begin
|
|||
end;
|
||||
|
||||
{ finish CRC calculation }
|
||||
Item.CRC32 := not CRC32;
|
||||
Item.CRC32 := LongInt(CRC32);
|
||||
|
||||
{ show final progress increment }
|
||||
if (Percent < 100) and Assigned(Archive.OnProgress) then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue