changed default constructor and initialized vectors with size to avoid early copying
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -16,7 +16,7 @@ struct LayerCommand {
|
||||
|
||||
class LayerStack {
|
||||
public:
|
||||
LayerStack() = default;
|
||||
LayerStack();
|
||||
~LayerStack();
|
||||
|
||||
void PushLayer(std::unique_ptr<Layer> layer);
|
||||
|
||||
Reference in New Issue
Block a user