mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-20 15:08:19 +00:00
Fix performance-inefficient-vector-operation
This commit is contained in:
parent
bab382f4cc
commit
f50eeab690
|
@ -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]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue