changed default constructor and initialized vectors with size to avoid early copying

This commit is contained in:
2026-04-10 10:54:14 +02:00
parent b964c2257b
commit 96c19efaea
2 changed files with 7 additions and 1 deletions

View File

@@ -4,6 +4,12 @@
#include <vector>
namespace SakuraVNE {
LayerStack::LayerStack() {
m_LayerStack.reserve(3);
m_CommandQueue.reserve(10);
}
LayerStack::~LayerStack() {
for (auto &layer : m_LayerStack) {
layer->OnDetach();

View File

@@ -16,7 +16,7 @@ struct LayerCommand {
class LayerStack {
public:
LayerStack() = default;
LayerStack();
~LayerStack();
void PushLayer(std::unique_ptr<Layer> layer);