mirror of
https://github.com/nomic-ai/gpt4all.git
synced 2025-07-05 19:46:30 +00:00
download: don't read whole file into ram to md5 it
we go to the trouble of using a tempfile and then reintroduce a case of reading the whole file into ram again?
This commit is contained in:
parent
18fa61c025
commit
5641c365af
@ -271,7 +271,6 @@ void HashAndSaveFile::hashAndSave(const QString &expectedHash, const QString &sa
|
|||||||
}
|
}
|
||||||
|
|
||||||
QCryptographicHash hash(QCryptographicHash::Md5);
|
QCryptographicHash hash(QCryptographicHash::Md5);
|
||||||
hash.addData(tempFile->readAll());
|
|
||||||
while(!tempFile->atEnd())
|
while(!tempFile->atEnd())
|
||||||
hash.addData(tempFile->read(16384));
|
hash.addData(tempFile->read(16384));
|
||||||
if (hash.result().toHex() != expectedHash) {
|
if (hash.result().toHex() != expectedHash) {
|
||||||
|
Loading…
Reference in New Issue
Block a user