mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
UPD: Speed up checksum calculation
This commit is contained in:
parent
7d644055cd
commit
718d279ea7
2 changed files with 10 additions and 4 deletions
|
|
@ -47,7 +47,7 @@ implementation
|
|||
|
||||
uses
|
||||
//Lazarus, Free-Pascal, etc.
|
||||
LCLProc, LazUTF8, crc,
|
||||
LCLProc, LazUTF8, DCcrc32,
|
||||
|
||||
//DC
|
||||
uOSUtils, DCOSUtils, uLng, uFileSystemUtil, uFileSystemFileSource,
|
||||
|
|
@ -297,7 +297,10 @@ begin
|
|||
TotalBytesToRead := TotalBytesToRead - BytesRead;
|
||||
BytesWritten := 0;
|
||||
|
||||
if BytesRead>0 then CurrentCRC32:=crc32(CurrentCRC32,FBuffer,BytesRead);
|
||||
if BytesRead > 0 then
|
||||
begin
|
||||
CurrentCRC32:= crc32_16bytes(FBuffer, BytesRead, CurrentCRC32);
|
||||
end;
|
||||
|
||||
repeat
|
||||
try
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ implementation
|
|||
|
||||
uses
|
||||
//Lazarus, Free-Pascal, etc.
|
||||
LCLProc, LazUTF8, crc,
|
||||
LCLProc, LazUTF8, DCcrc32,
|
||||
|
||||
//DC
|
||||
DCConvertEncoding, uOSUtils, DCOSUtils, uLng, uFileProcs;
|
||||
|
|
@ -262,7 +262,10 @@ begin
|
|||
if (BytesRead = 0) then
|
||||
Raise EReadError.Create(mbSysErrorMessage(GetLastOSError));
|
||||
|
||||
if RequireACRC32VerificationFile then CurrentCRC32:=crc32(CurrentCRC32,FBuffer,BytesRead);
|
||||
if RequireACRC32VerificationFile then
|
||||
begin
|
||||
CurrentCRC32:= crc32_16bytes(FBuffer, BytesRead, CurrentCRC32);
|
||||
end;
|
||||
|
||||
TotalBytesToRead := TotalBytesToRead - BytesRead;
|
||||
BytesWritten := 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue