Speed up texture cache init. (Was exceptionally slow with a debugger attached)

This commit is contained in:
Shyotl
2018-04-29 01:58:04 -05:00
parent 798f4c1a69
commit 07835ea832
3 changed files with 12 additions and 13 deletions

View File

@@ -1305,14 +1305,12 @@ void LLTextureCache::writeEntriesAndClose(const std::vector<Entry>& entries)
if (!mReadOnly)
{
LLAPRFile* aprfile = openHeaderEntriesFile(false, (S32)sizeof(EntriesInfo));
for (S32 idx=0; idx<num_entries; idx++)
U64 write_size = U64(sizeof(Entry)) * num_entries;
U64 bytes_written = aprfile->write((void*)(entries.data()), write_size);
if (bytes_written != write_size)
{
S32 bytes_written = aprfile->write((void*)(&entries[idx]), (S32)sizeof(Entry));
if(bytes_written != sizeof(Entry))
{
clearCorruptedCache(); //clear the cache.
return;
}
clearCorruptedCache(); //clear the cache.
return;
}
closeHeaderEntriesFile();
}