From 1ac701cc378d002817463d9e4101f8866254fe42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Mikrut?= Date: Thu, 26 Dec 2019 17:38:08 +0100 Subject: [PATCH] Don't use constant reference in Vector push_back, insert and append_array --- core/vector.h | 10 +++++----- editor/import/editor_scene_importer_gltf.h | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/core/vector.h b/core/vector.h index e6bb4a96fc4..d78354058fb 100644 --- a/core/vector.h +++ b/core/vector.h @@ -63,7 +63,7 @@ private: CowData _cowdata; public: - bool push_back(const T &p_elem); + bool push_back(T p_elem); void remove(int p_index) { _cowdata.remove(p_index); } void erase(const T &p_val) { @@ -83,10 +83,10 @@ public: _FORCE_INLINE_ int size() const { return _cowdata.size(); } Error resize(int p_size) { return _cowdata.resize(p_size); } _FORCE_INLINE_ const T &operator[](int p_index) const { return _cowdata.get(p_index); } - Error insert(int p_pos, const T &p_val) { return _cowdata.insert(p_pos, p_val); } + Error insert(int p_pos, T p_val) { return _cowdata.insert(p_pos, p_val); } int find(const T &p_val, int p_from = 0) const { return _cowdata.find(p_val, p_from); } - void append_array(const Vector &p_other); + void append_array(Vector p_other); template void sort_custom() { @@ -136,7 +136,7 @@ void Vector::invert() { } template -void Vector::append_array(const Vector &p_other) { +void Vector::append_array(Vector p_other) { const int ds = p_other.size(); if (ds == 0) return; @@ -147,7 +147,7 @@ void Vector::append_array(const Vector &p_other) { } template -bool Vector::push_back(const T &p_elem) { +bool Vector::push_back(T p_elem) { Error err = resize(size() + 1); ERR_FAIL_COND_V(err, true); diff --git a/editor/import/editor_scene_importer_gltf.h b/editor/import/editor_scene_importer_gltf.h index 6021bf10c86..173d3ec00e4 100644 --- a/editor/import/editor_scene_importer_gltf.h +++ b/editor/import/editor_scene_importer_gltf.h @@ -172,7 +172,10 @@ class EditorSceneImporterGLTF : public EditorSceneImporter { min = 0; max = 0; sparse_count = 0; + sparse_indices_buffer_view = 0; sparse_indices_byte_offset = 0; + sparse_indices_component_type = 0; + sparse_values_buffer_view = 0; sparse_values_byte_offset = 0; } };