changed default constructor and initialized vectors with size to avoid early copying
This commit is contained in:
@@ -4,6 +4,12 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace SakuraVNE {
|
namespace SakuraVNE {
|
||||||
|
|
||||||
|
LayerStack::LayerStack() {
|
||||||
|
m_LayerStack.reserve(3);
|
||||||
|
m_CommandQueue.reserve(10);
|
||||||
|
}
|
||||||
|
|
||||||
LayerStack::~LayerStack() {
|
LayerStack::~LayerStack() {
|
||||||
for (auto &layer : m_LayerStack) {
|
for (auto &layer : m_LayerStack) {
|
||||||
layer->OnDetach();
|
layer->OnDetach();
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ struct LayerCommand {
|
|||||||
|
|
||||||
class LayerStack {
|
class LayerStack {
|
||||||
public:
|
public:
|
||||||
LayerStack() = default;
|
LayerStack();
|
||||||
~LayerStack();
|
~LayerStack();
|
||||||
|
|
||||||
void PushLayer(std::unique_ptr<Layer> layer);
|
void PushLayer(std::unique_ptr<Layer> layer);
|
||||||
|
|||||||
Reference in New Issue
Block a user