diff --git a/indra/llui/llaccordionctrl.cpp b/indra/llui/llaccordionctrl.cpp index 58266fc2d8..495ba2f40f 100644 --- a/indra/llui/llaccordionctrl.cpp +++ b/indra/llui/llaccordionctrl.cpp @@ -316,11 +316,7 @@ void LLAccordionCtrl::ctrlShiftVertical(LLView* panel, S32 delta) //--------------------------------------------------------------------------------- -// If adding a lot of controls rapidly, calling arrange will cost a lot of times, as it's running through n! controls. -// In that case we can avvoid calling arrange over and over and just call it once when finished. -//void LLAccordionCtrl::addCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab) -void LLAccordionCtrl::addCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab, bool aArrange) -// +void LLAccordionCtrl::addCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab) { if (!accordion_tab) return; @@ -329,14 +325,7 @@ void LLAccordionCtrl::addCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab, bool mAccordionTabs.push_back(accordion_tab); accordion_tab->setDropDownStateChangedCallback( boost::bind(&LLAccordionCtrl::onCollapseCtrlCloseOpen, this, (S16)(mAccordionTabs.size() - 1)) ); - - // If adding a lot of controls rapidly, calling arrange will cost a lot of times, as it's running through n! controls. - // In that case we can avvoid calling arrange over and over and just call it once when finished. - - // arrange(); - if( aArrange ) - arrange(); - // + arrange(); } void LLAccordionCtrl::removeCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab) diff --git a/indra/llui/llaccordionctrl.h b/indra/llui/llaccordionctrl.h index c4d7c276e1..43a33a2b3c 100644 --- a/indra/llui/llaccordionctrl.h +++ b/indra/llui/llaccordionctrl.h @@ -103,11 +103,7 @@ public: // Call reshape after changing splitter's size virtual void reshape(S32 width, S32 height, bool called_from_parent = true); - // If adding a lot of controls rapidly, calling arrange will cost a lot of times, as it's running through n! controls. - // In that case we can avvoid calling arrange over and over and just call it once when finished. - // void addCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab); - void addCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab, bool aArrange = true /*Standard is true as to not mess with old code all over the place*/ ); - // + void addCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab); void removeCollapsibleCtrl(LLAccordionCtrlTab* accordion_tab); void arrange(); diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index ba5335e8df..3b44f7a22e 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -220,11 +220,7 @@ void LLOutfitsList::updateAddedCategory(LLUUID cat_id) // *TODO: LLUICtrlFactory::defaultBuilder does not use "display_children" from xml. Should be investigated. tab->setDisplayChildren(false); - - // Calling this when there's a lot of outfits causes horrible perfomance and disconnects, due to arrange eating so many cpu cycles. - //mAccordion->addCollapsibleCtrl(tab); - mAccordion->addCollapsibleCtrl(tab, false); - // + mAccordion->addCollapsibleCtrl(tab); // Start observing the new outfit category. LLWearableItemsList* list = tab->getChild("wearable_items_list"); @@ -1121,7 +1117,7 @@ void LLOutfitListBase::refreshList(const LLUUID& category_id) // FIRE-6958/VWR-2862; Handle large amounts of outfits, write a least a warning into the logs. S32 currentOutfitsAmount = (S32)mRefreshListState.Added.size(); - S32 maxSuggestedOutfits = 200; + constexpr S32 maxSuggestedOutfits = 200; if (currentOutfitsAmount > maxSuggestedOutfits) { LL_WARNS() << "Large amount of outfits found: " << currentOutfitsAmount << " this may cause hangs and disconnects" << LL_ENDL; @@ -1187,9 +1183,6 @@ void LLOutfitListBase::onIdleRefreshList() mRefreshListState.Added.clear(); mRefreshListState.AddedIterator = mRefreshListState.Added.end(); - // We called mAccordion->addCollapsibleCtrl with false as second paramter and did not let it arrange itself each time. Do this here after all is said and done. - arrange(); - // Handle removed tabs. while (mRefreshListState.RemovedIterator < mRefreshListState.Removed.end()) { @@ -1213,8 +1206,8 @@ void LLOutfitListBase::onIdleRefreshList() // Links aren't supposed to be allowed here, check only cats if (cat) - { - std::string name = cat->getName(); + { + std::string name = cat->getName(); updateChangedCategoryName(cat, name); }