summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorBeq <beqjanus@gmail.com>2024-04-15 12:23:11 +0100
committerBeq <beqjanus@gmail.com>2024-04-15 12:23:11 +0100
commit614b9739ff208cdfa4f63a3f86e605a66ce5297b (patch)
tree98bb50a17da304ade2eb0cdd21eb24e1adc68592 /indra/newview
parent64c541f40191dee0fb6b3b0c09d0d9bfacb454a5 (diff)
lift variable out of loop and fix a missing bracket.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llvocache.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/indra/newview/llvocache.cpp b/indra/newview/llvocache.cpp
index e0b7a5929a..d0ae8e9399 100644
--- a/indra/newview/llvocache.cpp
+++ b/indra/newview/llvocache.cpp
@@ -1512,8 +1512,8 @@ bool LLVOCache::readFromCache(U64 handle, const LLUUID& id, LLVOCacheEntry::voca
bool success = true ;
S32 num_entries = 0 ; // lifted out of inner loop.
+ std::string filename; // lifted out of loop
{
- std::string filename;
LLUUID cache_id;
getObjectCacheFilename(handle, filename);
LLAPRFile apr_file(filename, APR_READ|APR_BINARY, mLocalAPRFilePoolp);
@@ -1588,7 +1588,8 @@ void LLVOCache::readGenericExtrasFromCache(U64 handle, const LLUUID& id, LLVOCac
std::string line;
std::getline(in, line);
- if(!in.good()) {
+ if(!in.good())
+ {
LL_WARNS() << "Failed reading extras cache for handle " << handle << LL_ENDL;
in.close();
removeGenericExtrasForHandle(handle);
@@ -1624,13 +1625,15 @@ void LLVOCache::readGenericExtrasFromCache(U64 handle, const LLUUID& id, LLVOCac
U32 num_entries; // if removal was enabled during write num_entries might be wrong
std::getline(in, line);
- if(!in.good()) {
+ if(!in.good())
+ {
LL_WARNS() << "Failed reading extras cache for handle " << handle << LL_ENDL;
in.close();
removeGenericExtrasForHandle(handle);
return;
}
- try {
+ try
+ {
num_entries = std::stol(line);
}
catch(std::logic_error&) // either invalid_argument or out_of_range
@@ -1649,11 +1652,13 @@ void LLVOCache::readGenericExtrasFromCache(U64 handle, const LLUUID& id, LLVOCac
static const U32 max_size = 4096;
bool success = LLSDSerialize::deserialize(entry_llsd, in, max_size);
// check bool(in) this time since eof is not a failure condition here
- if(!success || !in) {
+ if(!success || !in)
+ {
LL_WARNS() << "Failed reading extras cache for handle " << handle << ", entry number " << i << " cache patrtial load only." << LL_ENDL;
in.close();
removeGenericExtrasForHandle(handle);
break;
+ }
LLGLTFOverrideCacheEntry entry;
entry.fromLLSD(entry_llsd);