diff options
| author | Bojidar Marinov | 2018-03-09 21:16:08 +0200 |
|---|---|---|
| committer | Bojidar Marinov | 2018-03-13 17:18:08 +0200 |
| commit | 9f6c0c6eaef754f2049ee536c5b38bfdc65fbd08 (patch) | |
| tree | 823f108360644d6403500810f31d08d7d5e37160 /core/array.cpp | |
| parent | b84236944215445be191047ab628e570ffd69e99 (diff) | |
| download | godot-9f6c0c6eaef754f2049ee536c5b38bfdc65fbd08.tar.gz godot-9f6c0c6eaef754f2049ee536c5b38bfdc65fbd08.tar.zst godot-9f6c0c6eaef754f2049ee536c5b38bfdc65fbd08.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; |
