summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationmodel.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-04-27 20:18:44 +0300
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2020-04-28 18:13:14 +0300
commit1062164cfecf7637e48c6f4fb51fe12681470523 (patch)
treeac63f3ecf28343742657e75aaf2757202f42cdc3 /indra/newview/llconversationmodel.cpp
parent694c6e1d84d20413f97dabf7bbca6a3d6b5c59f9 (diff)
SL-13119 Duplicate check was causing slowdowns
Diffstat (limited to 'indra/newview/llconversationmodel.cpp')
-rw-r--r--indra/newview/llconversationmodel.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp
index c258136889..4aa74a550c 100644
--- a/indra/newview/llconversationmodel.cpp
+++ b/indra/newview/llconversationmodel.cpp
@@ -92,6 +92,23 @@ LLConversationItem::~LLConversationItem()
}
}
+//virtual
+void LLConversationItem::addChild(LLFolderViewModelItem* child)
+{
+ // Avoid duplicates: bail out if that child is already present in the list
+ // Note: this happens when models are created and 'parented' before views
+ // This is performance unfriendly, but conversation can addToFolder multiple times
+ child_list_t::const_iterator iter;
+ for (iter = mChildren.begin(); iter != mChildren.end(); iter++)
+ {
+ if (child == *iter)
+ {
+ return;
+ }
+ }
+ LLFolderViewModelItemCommon::addChild(child);
+}
+
void LLConversationItem::postEvent(const std::string& event_type, LLConversationItemSession* session, LLConversationItemParticipant* participant)
{
LLUUID session_id = (session ? session->getUUID() : LLUUID());