Skip to content
Snippets Groups Projects
Commit e7c975b2 authored by Rye Mutt's avatar Rye Mutt :bread:
Browse files

Add LLMessageSystem::hasFast to avoid excessive mutex locks and string finds

parent bd1a5b81
No related branches found
No related tags found
No related merge requests found
...@@ -3962,6 +3962,11 @@ BOOL LLMessageSystem::has(const char *blockname) const ...@@ -3962,6 +3962,11 @@ BOOL LLMessageSystem::has(const char *blockname) const
return getNumberOfBlocks(blockname) > 0; return getNumberOfBlocks(blockname) > 0;
} }
BOOL LLMessageSystem::hasFast(const char *blockname) const
{
return getNumberOfBlocksFast(blockname) > 0;
}
S32 LLMessageSystem::getNumberOfBlocksFast(const char *blockname) const S32 LLMessageSystem::getNumberOfBlocksFast(const char *blockname) const
{ {
return mMessageReader->getNumberOfBlocks(blockname); return mMessageReader->getNumberOfBlocks(blockname);
......
...@@ -726,6 +726,7 @@ class LLMessageSystem : public LLMessageSenderInterface ...@@ -726,6 +726,7 @@ class LLMessageSystem : public LLMessageSenderInterface
void sanityCheck(); void sanityCheck();
BOOL has(const char *blockname) const; BOOL has(const char *blockname) const;
BOOL hasFast(const char *blockname) const;
S32 getNumberOfBlocksFast(const char *blockname) const; S32 getNumberOfBlocksFast(const char *blockname) const;
S32 getNumberOfBlocks(const char *blockname) const; S32 getNumberOfBlocks(const char *blockname) const;
S32 getSizeFast(const char *blockname, const char *varname) const; S32 getSizeFast(const char *blockname, const char *varname) const;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment