Faster parts list sorting.

This commit is contained in:
Leonardo Zide
2019-11-23 10:46:18 -08:00
parent bd25c7f31a
commit 33fe9cfac2
3 changed files with 10 additions and 39 deletions
+4 -3
View File
@@ -144,12 +144,13 @@ void lcPartSelectionListModel::SetCategory(int CategoryIndex)
}
}
auto lcPartSortFunc=[](PieceInfo* const& a, PieceInfo* const& b)
auto lcPartSortFunc=[](const PieceInfo* a, const PieceInfo* b)
{
return strcmp(a->m_strDescription, b->m_strDescription);
return strcmp(a->m_strDescription, b->m_strDescription) < 0;
};
SingleParts.Sort(lcPartSortFunc);
std::sort(SingleParts.begin(), SingleParts.end(), lcPartSortFunc);
mParts.resize(SingleParts.GetSize());
for (int PartIdx = 0; PartIdx < SingleParts.GetSize(); PartIdx++)