summaryrefslogtreecommitdiff
path: root/indra/newview/lltexturecache.cpp
diff options
context:
space:
mode:
authorFrederick Martian <fredmartian@gmail.com>2025-12-04 00:10:42 +0100
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-12-10 20:33:58 +0200
commit2438854ea33d0a2f8d9fb13d2e3ef6f7d9bda235 (patch)
tree473b4284b3941a7b1ea09102e717927f3956bdcd /indra/newview/lltexturecache.cpp
parente0c5fc80c78be6ce16d835a249c9da56c991b226 (diff)
Incorporate some of the comment improvements suggested by Copilot and make LLFile::size() return -1 on error and adjust the callers to account for that.
Diffstat (limited to 'indra/newview/lltexturecache.cpp')
-rwxr-xr-xindra/newview/lltexturecache.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/indra/newview/lltexturecache.cpp b/indra/newview/lltexturecache.cpp
index ad222f229f..a6d81816ce 100755
--- a/indra/newview/lltexturecache.cpp
+++ b/indra/newview/lltexturecache.cpp
@@ -181,7 +181,6 @@ bool LLTextureCacheLocalFileWorker::doRead()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE;
S32 local_size = (S32)LLFile::size(mFileName);
-
if (local_size > 0 && mFileName.size() > 4)
{
mDataSize = local_size; // Only a complete file is valid
@@ -444,7 +443,7 @@ bool LLTextureCacheRemoteWorker::doRead()
std::string filename = mCache->getTextureFileName(mID);
S32 filesize = (S32)LLFile::size(filename);
- if (filesize && (filesize + TEXTURE_CACHE_ENTRY_SIZE) > mOffset)
+ if (filesize > 0 && (filesize + TEXTURE_CACHE_ENTRY_SIZE) > mOffset)
{
S32 max_datasize = TEXTURE_CACHE_ENTRY_SIZE + filesize - mOffset;
mDataSize = llmin(max_datasize, mDataSize);
@@ -934,8 +933,6 @@ const char* fast_cache_filename = "FastCache.cache";
void LLTextureCache::setDirNames(ELLPath location)
{
-// std::string delem = gDirUtilp->getDirDelimiter();
-
mHeaderEntriesFileName = gDirUtilp->getExpandedFilename(location, textures_dirname, entries_filename);
mHeaderDataFileName = gDirUtilp->getExpandedFilename(location, textures_dirname, cache_filename);
mTexturesDirName = gDirUtilp->getExpandedFilename(location, textures_dirname);