summaryrefslogtreecommitdiff
path: root/indra/llmessage/llexperiencecache.cpp
diff options
context:
space:
mode:
authordolphin <dolphin@lindenlab.com>2014-03-17 15:57:15 -0700
committerdolphin <dolphin@lindenlab.com>2014-03-17 15:57:15 -0700
commit74dcc04e69b845e62d25e83b615399f8a5d26d21 (patch)
tree7b951b6c770cb41d4f5787f92d828cf5e5b86bd5 /indra/llmessage/llexperiencecache.cpp
parente10ae3ba960cf030582378c454937dd326fcd436 (diff)
Updated experience cache to get a const reference to xp data
Diffstat (limited to 'indra/llmessage/llexperiencecache.cpp')
-rw-r--r--indra/llmessage/llexperiencecache.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/indra/llmessage/llexperiencecache.cpp b/indra/llmessage/llexperiencecache.cpp
index 648e2039a6..c8deaac1ef 100644
--- a/indra/llmessage/llexperiencecache.cpp
+++ b/indra/llmessage/llexperiencecache.cpp
@@ -320,9 +320,9 @@ namespace LLExperienceCache
for ( ; it != mKeys.end(); ++it)
{
- LLSD exp;
+ LLSD exp = get(it->first);
//leave the properties alone if we already have a cache entry for this xp
- if(!get(it->first, exp))
+ if(exp.isUndefined())
{
exp[PROPERTIES]=PROPERTY_INVALID;
}
@@ -563,24 +563,21 @@ namespace LLExperienceCache
LL_WARNS("ExperienceCache") << ": Ignoring cache insert of experience which is missing " << EXPERIENCE_ID << LL_ENDL;
}
}
-
- bool get( const LLUUID& key, LLSD& experience_data )
+ static LLSD empty;
+ const LLSD& get(const LLUUID& key)
{
- if(key.isNull()) return false;
+ if(key.isNull()) return empty;
cache_t::const_iterator it = sCache.find(key);
-
+
if (it != sCache.end())
{
- experience_data = it->second;
- return true;
+ return it->second;
}
-
+
fetch(key);
- return false;
+ return empty;
}
-
-
void get( const LLUUID& key, callback_slot_t slot )
{
if(key.isNull()) return;