Fix performance-inefficient-vector-operation

This commit is contained in:
Robert Müller 2023-12-14 21:24:21 +01:00
parent bab382f4cc
commit f50eeab690

View file

@ -1078,6 +1078,7 @@ void CEditorActionEditLayersGroupAndOrder::Undo()
auto &pCurrentGroup = Map.m_vpGroups[m_NewGroupIndex];
auto &pPreviousGroup = Map.m_vpGroups[m_GroupIndex];
std::vector<std::shared_ptr<CLayer>> vpLayers;
vpLayers.reserve(m_NewLayerIndices.size());
for(auto &LayerIndex : m_NewLayerIndices)
vpLayers.push_back(pCurrentGroup->m_vpLayers[LayerIndex]);
@ -1099,6 +1100,7 @@ void CEditorActionEditLayersGroupAndOrder::Redo()
auto &pCurrentGroup = Map.m_vpGroups[m_GroupIndex];
auto &pPreviousGroup = Map.m_vpGroups[m_NewGroupIndex];
std::vector<std::shared_ptr<CLayer>> vpLayers;
vpLayers.reserve(m_LayerIndices.size());
for(auto &LayerIndex : m_LayerIndices)
vpLayers.push_back(pCurrentGroup->m_vpLayers[LayerIndex]);