summaryrefslogtreecommitdiff
path: root/indra/newview/llmeshrepository.cpp
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2025-07-14 18:47:03 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2025-07-14 19:48:52 +0300
commit5a50be4e1554c6f96ff52fdbda5ba1c890d18a6d (patch)
tree294531638dd784bee7171edbc040c7d770942924 /indra/newview/llmeshrepository.cpp
parentd033bbacf0d38079c1879acd04e54e341e78146e (diff)
#4294 Make upload order more deterministic #2
Diffstat (limited to 'indra/newview/llmeshrepository.cpp')
-rw-r--r--indra/newview/llmeshrepository.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index 6236df1a13..142a3dac39 100644
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2699,18 +2699,11 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
S32 instance_num = 0;
- // Upload should happen in deterministic order, so sort instances by model name.
- // Note: probably can sort by mBaseModel->mSubmodelID here as well to avoid
- // running over the list twice.
- std::vector<std::pair<LLModel*, instance_list>> sorted_instances(mInstance.begin(), mInstance.end());
- std::sort(sorted_instances.begin(), sorted_instances.end(),
- [](const std::pair<LLModel*, instance_list>& a, const std::pair<LLModel*, instance_list>& b)
- {
- return a.first->mLabel < b.first->mLabel;
- });
-
- // Handle models, ignore submodels for now
- for (auto& iter : sorted_instances)
+ // Handle models, ignore submodels for now.
+ // Probably should pre-sort by mSubmodelID instead of running twice.
+ // Note: mInstance should be sorted by model name for the sake of
+ // deterministic order.
+ for (auto& iter : mInstance)
{
LLMeshUploadData data;
data.mBaseModel = iter.first;
@@ -2869,7 +2862,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
}
// Now handle the submodels.
- for (auto& iter : sorted_instances)
+ for (auto& iter : mInstance)
{
LLMeshUploadData data;
data.mBaseModel = iter.first;