@@ -2699,18 +2699,11 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
26992699
27002700 S32 instance_num = 0 ;
27012701
2702- // Upload should happen in deterministic order, so sort instances by model name.
2703- // Note: probably can sort by mBaseModel->mSubmodelID here as well to avoid
2704- // running over the list twice.
2705- std::vector<std::pair<LLModel*, instance_list>> sorted_instances (mInstance .begin (), mInstance .end ());
2706- std::sort (sorted_instances.begin (), sorted_instances.end (),
2707- [](const std::pair<LLModel*, instance_list>& a, const std::pair<LLModel*, instance_list>& b)
2708- {
2709- return a.first ->mLabel < b.first ->mLabel ;
2710- });
2711-
2712- // Handle models, ignore submodels for now
2713- for (auto & iter : sorted_instances)
2702+ // Handle models, ignore submodels for now.
2703+ // Probably should pre-sort by mSubmodelID instead of running twice.
2704+ // Note: mInstance should be sorted by model name for the sake of
2705+ // deterministic order.
2706+ for (auto & iter : mInstance )
27142707 {
27152708 LLMeshUploadData data;
27162709 data.mBaseModel = iter.first ;
@@ -2869,7 +2862,7 @@ void LLMeshUploadThread::wholeModelToLLSD(LLSD& dest, bool include_textures)
28692862 }
28702863
28712864 // Now handle the submodels.
2872- for (auto & iter : sorted_instances )
2865+ for (auto & iter : mInstance )
28732866 {
28742867 LLMeshUploadData data;
28752868 data.mBaseModel = iter.first ;
0 commit comments