diff options
| author | Juan Linietsky | 2018-04-08 09:39:03 -0300 |
|---|---|---|
| committer | GitHub | 2018-04-08 09:39:03 -0300 |
| commit | 4ee3f3251dc55ae49c873bc1895cecf75bc0bf8a (patch) | |
| tree | ad5442ba88596748b67ec6834a50b61543c8d916 /core/array.cpp | |
| parent | 8a5fb669ae3590fa1aa3f1fb90d01c3dca843c94 (diff) | |
| parent | 9f6c0c6eaef754f2049ee536c5b38bfdc65fbd08 (diff) | |
| download | godot-4ee3f3251dc55ae49c873bc1895cecf75bc0bf8a.tar.gz godot-4ee3f3251dc55ae49c873bc1895cecf75bc0bf8a.tar.zst godot-4ee3f3251dc55ae49c873bc1895cecf75bc0bf8a.zip | |
Diffstat (limited to 'core/array.cpp')
| -rw-r--r-- | core/array.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/array.cpp b/core/array.cpp index 0ddac1662..9e3250fd4 100644 --- a/core/array.cpp +++ b/core/array.cpp @@ -35,8 +35,8 @@ #include "variant.h" #include "vector.h" -struct ArrayPrivate { - +class ArrayPrivate { +public: SafeRefCount refcount; Vector<Variant> array; }; @@ -211,13 +211,13 @@ const Variant &Array::get(int p_idx) const { return operator[](p_idx); } -Array Array::duplicate() const { +Array Array::duplicate(bool p_deep) const { Array new_arr; int element_count = size(); new_arr.resize(element_count); for (int i = 0; i < element_count; i++) { - new_arr[i] = get(i); + new_arr[i] = p_deep ? get(i).duplicate(p_deep) : get(i); } return new_arr; |
