summaryrefslogtreecommitdiff
path: root/indra/newview/llavatarlist.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llavatarlist.cpp')
-rw-r--r--indra/newview/llavatarlist.cpp26
1 files changed, 7 insertions, 19 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp
index 8ba47b5198..dfb213716c 100644
--- a/indra/newview/llavatarlist.cpp
+++ b/indra/newview/llavatarlist.cpp
@@ -34,6 +34,7 @@
// common
#include "lltrans.h"
+#include "llcommonutils.h"
#include "llavatarlist.h"
#include "llagentdata.h" // for comparator
@@ -176,13 +177,15 @@ void LLAvatarList::clear()
void LLAvatarList::setNameFilter(const std::string& filter)
{
- if (mNameFilter != filter)
+ std::string filter_upper = filter;
+ LLStringUtil::toUpper(filter_upper);
+ if (mNameFilter != filter_upper)
{
- mNameFilter = filter;
+ mNameFilter = filter_upper;
// update message for empty state here instead of refresh() to avoid blinking when switch
// between tabs.
- updateNoItemsMessage(!mNameFilter.empty());
+ updateNoItemsMessage(filter);
setDirty();
}
}
@@ -404,7 +407,6 @@ void LLAvatarList::computeDifference(
uuid_vec_t& vremoved)
{
uuid_vec_t vcur;
- uuid_vec_t vnew = vnew_unsorted;
// Convert LLSDs to LLUUIDs.
{
@@ -415,21 +417,7 @@ void LLAvatarList::computeDifference(
vcur.push_back(vcur_values[i].asUUID());
}
- std::sort(vcur.begin(), vcur.end());
- std::sort(vnew.begin(), vnew.end());
-
- uuid_vec_t::iterator it;
- size_t maxsize = llmax(vcur.size(), vnew.size());
- vadded.resize(maxsize);
- vremoved.resize(maxsize);
-
- // what to remove
- it = set_difference(vcur.begin(), vcur.end(), vnew.begin(), vnew.end(), vremoved.begin());
- vremoved.erase(it, vremoved.end());
-
- // what to add
- it = set_difference(vnew.begin(), vnew.end(), vcur.begin(), vcur.end(), vadded.begin());
- vadded.erase(it, vadded.end());
+ LLCommonUtils::computeDifference(vnew_unsorted, vcur, vadded, vremoved);
}
// Refresh shown time of our last interaction with all listed avatars.