diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-04-27 20:18:44 +0300 | 
|---|---|---|
| committer | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2020-04-28 18:13:14 +0300 | 
| commit | 1062164cfecf7637e48c6f4fb51fe12681470523 (patch) | |
| tree | ac63f3ecf28343742657e75aaf2757202f42cdc3 | |
| parent | 694c6e1d84d20413f97dabf7bbca6a3d6b5c59f9 (diff) | |
SL-13119 Duplicate check was causing slowdowns
| -rw-r--r-- | indra/llui/llfolderviewmodel.h | 12 | ||||
| -rw-r--r-- | indra/newview/llconversationmodel.cpp | 17 | ||||
| -rw-r--r-- | indra/newview/llconversationmodel.h | 1 | 
3 files changed, 19 insertions, 11 deletions
diff --git a/indra/llui/llfolderviewmodel.h b/indra/llui/llfolderviewmodel.h index f71a88c56e..84a1539094 100644 --- a/indra/llui/llfolderviewmodel.h +++ b/indra/llui/llfolderviewmodel.h @@ -285,17 +285,7 @@ public:  	typedef std::list<LLFolderViewModelItem*> child_list_t;  	virtual void addChild(LLFolderViewModelItem* child)  -	{  -		// Avoid duplicates: bail out if that child is already present in the list -		// Note: this happens when models are created before views -		child_list_t::const_iterator iter; -		for (iter = mChildren.begin(); iter != mChildren.end(); iter++) -		{ -			if (child == *iter) -			{ -				return; -			} -		} +	{  		mChildren.push_back(child);  		child->setParent(this);   		dirtyFilter(); 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()); diff --git a/indra/newview/llconversationmodel.h b/indra/newview/llconversationmodel.h index 80385fad5f..30c7481864 100644 --- a/indra/newview/llconversationmodel.h +++ b/indra/newview/llconversationmodel.h @@ -96,6 +96,7 @@ public:  	virtual void buildContextMenu(LLMenuGL& menu, U32 flags) { }  	virtual BOOL isUpToDate() const { return TRUE; }  	virtual bool hasChildren() const { return FALSE; } +    virtual void addChild(LLFolderViewModelItem* child);  	virtual bool potentiallyVisible() { return true; }  	virtual bool filter( LLFolderViewFilter& filter) { return false; }  | 
