From bf7faa3267e549b01131c6746202a5b6cda8e68a Mon Sep 17 00:00:00 2001 From: Henri Beauchamp Date: Mon, 6 Feb 2023 11:30:23 +0100 Subject: Faster and simpler inventory category hashing. This commit changes inventory category hashing from slow LLMD5 to fast HBXX128 hashing, and allows to use a simple LLUUID for the hash, instead of an LLMD5 instance. It also removes some old cruft dealing with unused baked texture hashing. --- indra/newview/llinventorymodel.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 6ba04cdff2..b41ad51fa4 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -62,6 +62,7 @@ #include "bufferarray.h" #include "bufferstream.h" #include "llcorehttputil.h" +#include "hbxxh.h" //#define DIFF_INVENTORY_FILES #ifdef DIFF_INVENTORY_FILES @@ -451,17 +452,16 @@ void LLInventoryModel::getDirectDescendentsOf(const LLUUID& cat_id, items = get_ptr_in_map(mParentChildItemTree, cat_id); } -LLMD5 LLInventoryModel::hashDirectDescendentNames(const LLUUID& cat_id) const +LLUUID LLInventoryModel::hashDirectDescendentNames(const LLUUID& cat_id) const { LLInventoryModel::cat_array_t* cat_array; LLInventoryModel::item_array_t* item_array; getDirectDescendentsOf(cat_id,cat_array,item_array); - LLMD5 item_name_hash; if (!item_array) { - item_name_hash.finalize(); - return item_name_hash; + return LLUUID::null; } + HBXXH128 item_name_hash; for (LLInventoryModel::item_array_t::const_iterator iter = item_array->begin(); iter != item_array->end(); iter++) @@ -471,8 +471,7 @@ LLMD5 LLInventoryModel::hashDirectDescendentNames(const LLUUID& cat_id) const continue; item_name_hash.update(item->getName()); } - item_name_hash.finalize(); - return item_name_hash; + return item_name_hash.digest(); } // SJB: Added version to lock the arrays to catch potential logic bugs -- cgit v1.2.3 From c3ab9487245ac77016f3b651e2db47d239941659 Mon Sep 17 00:00:00 2001 From: Henri Beauchamp Date: Tue, 7 Feb 2023 22:18:44 +0100 Subject: Added a digest_t typedef to clarify the usage of the digest LLUUID As suggested in comments for previous commit. --- indra/newview/llinventorymodel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index b41ad51fa4..e56a0ba414 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -452,7 +452,7 @@ void LLInventoryModel::getDirectDescendentsOf(const LLUUID& cat_id, items = get_ptr_in_map(mParentChildItemTree, cat_id); } -LLUUID LLInventoryModel::hashDirectDescendentNames(const LLUUID& cat_id) const +LLInventoryModel::digest_t LLInventoryModel::hashDirectDescendentNames(const LLUUID& cat_id) const { LLInventoryModel::cat_array_t* cat_array; LLInventoryModel::item_array_t* item_array; -- cgit v1.2.3 From ebbc09551adbf9f03681740987a488a61593acc6 Mon Sep 17 00:00:00 2001 From: Alexander Gavriliuk Date: Mon, 3 Apr 2023 23:21:25 +0200 Subject: SL-19036: Extra folder is created after dragging the inventory folder --- indra/newview/llinventorymodel.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'indra/newview/llinventorymodel.cpp') diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 46e76bc3f8..06050dc4a4 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -668,6 +668,7 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id, const std::string& pname, inventory_func_type callback) { + LL_DEBUGS(LOG_INV) << "Create '" << pname << "' in '" << make_inventory_path(parent_id) << "'" << LL_ENDL; LLUUID id; if (!isInventoryUsable()) { @@ -759,6 +760,7 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id, cat->packMessage(msg); gAgent.sendReliableMessage(); + LL_INFOS(LOG_INV) << "Created new category '" << make_inventory_path(id) << "'" << LL_ENDL; // return the folder id of the newly created folder return id; } @@ -1347,6 +1349,7 @@ void LLInventoryModel::moveObject(const LLUUID& object_id, const LLUUID& cat_id) LLPointer cat = getCategory(object_id); if(cat && (cat->getParentUUID() != cat_id)) { + LL_DEBUGS(LOG_INV) << "Move category '" << make_path(cat) << "' to '" << make_inventory_path(cat_id) << "'" << LL_ENDL; cat_array_t* cat_array; cat_array = getUnlockedCatArray(cat->getParentUUID()); if(cat_array) vector_replace_with_last(*cat_array, cat); @@ -1359,6 +1362,7 @@ void LLInventoryModel::moveObject(const LLUUID& object_id, const LLUUID& cat_id) LLPointer item = getItem(object_id); if(item && (item->getParentUUID() != cat_id)) { + LL_DEBUGS(LOG_INV) << "Move item '" << make_path(item) << "' to '" << make_inventory_path(cat_id) << "'" << LL_ENDL; item_array_t* item_array; item_array = getUnlockedItemArray(item->getParentUUID()); if(item_array) vector_replace_with_last(*item_array, item); @@ -1377,14 +1381,14 @@ void LLInventoryModel::changeItemParent(LLViewerInventoryItem* item, { if (item->getParentUUID() == new_parent_id) { - LL_DEBUGS(LOG_INV) << "'" << item->getName() << "' (" << item->getUUID() - << ") is already in folder " << new_parent_id << LL_ENDL; + LL_DEBUGS(LOG_INV) << make_info(item) << " is already in folder " << make_inventory_info(new_parent_id) << LL_ENDL; } else { - LL_INFOS(LOG_INV) << "Moving '" << item->getName() << "' (" << item->getUUID() - << ") from " << item->getParentUUID() << " to folder " - << new_parent_id << LL_ENDL; + LL_INFOS(LOG_INV) << "Move item " << make_info(item) + << " from " << make_inventory_info(item->getParentUUID()) + << " to " << make_inventory_info(new_parent_id) << LL_ENDL; + LLInventoryModel::update_list_t update; LLInventoryModel::LLCategoryUpdate old_folder(item->getParentUUID(),-1); update.push_back(old_folder); @@ -1416,6 +1420,10 @@ void LLInventoryModel::changeCategoryParent(LLViewerInventoryCategory* cat, return; } + LL_INFOS(LOG_INV) << "Move category " << make_info(cat) + << " from " << make_inventory_info(cat->getParentUUID()) + << " to " << make_inventory_info(new_parent_id) << LL_ENDL; + LLInventoryModel::update_list_t update; LLInventoryModel::LLCategoryUpdate old_folder(cat->getParentUUID(), -1); update.push_back(old_folder); -- cgit v1.2.3