diff options
author | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-04-27 10:20:30 +0300 |
---|---|---|
committer | Dmitry Zaporozhan <dzaporozhan@productengine.com> | 2010-04-27 10:20:30 +0300 |
commit | ca07973e3ebd0ed1b18325a077ba4553d051c662 (patch) | |
tree | a0f9de9cab2b374195301cb6b783af7750d603f4 /indra/newview/llavatarlist.cpp | |
parent | 17f2234a96d11a78726a77285b77dd25721ab8ce (diff) |
Making use of LLCommonUtils::computeDifference.
Replaced duplicating code with generic function LLCommonUtils::computeDifference()
Reviewed by Vadim Savchuk - https://codereview.productengine.com/secondlife/r/313/
--HG--
branch : product-engine
Diffstat (limited to 'indra/newview/llavatarlist.cpp')
-rw-r--r-- | indra/newview/llavatarlist.cpp | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/indra/newview/llavatarlist.cpp b/indra/newview/llavatarlist.cpp index 8ba47b5198..fd0b20281b 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 @@ -404,7 +405,6 @@ void LLAvatarList::computeDifference( uuid_vec_t& vremoved) { uuid_vec_t vcur; - uuid_vec_t vnew = vnew_unsorted; // Convert LLSDs to LLUUIDs. { @@ -415,21 +415,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. |