diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-09 18:31:35 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-09 18:31:35 +0200 |
commit | ca25c6e0a3f25948ee4a197f3442c66f019e7424 (patch) | |
tree | b597f183494f729063397b2f8cc410c680c17ec5 /core | |
parent | 629fa413ab0ccfa880edc81dcc9d39b1f4d10f39 (diff) | |
parent | bf64a068a40478838733190fd2c21b5dbace5457 (diff) |
Merge pull request #67103 from Mickeon/i-forgor
Fix Array.`slice()` and `filter()` forgetting Typed Array
Diffstat (limited to 'core')
-rw-r--r-- | core/variant/array.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/core/variant/array.cpp b/core/variant/array.cpp index c1bdd6a6bc..8b958814db 100644 --- a/core/variant/array.cpp +++ b/core/variant/array.cpp @@ -402,6 +402,7 @@ Array Array::recursive_duplicate(bool p_deep, int recursion_count) const { Array Array::slice(int p_begin, int p_end, int p_step, bool p_deep) const { Array result; + result._p->typed = _p->typed; ERR_FAIL_COND_V_MSG(p_step == 0, result, "Slice step cannot be zero."); @@ -433,6 +434,7 @@ Array Array::slice(int p_begin, int p_end, int p_step, bool p_deep) const { Array Array::filter(const Callable &p_callable) const { Array new_arr; new_arr.resize(size()); + new_arr._p->typed = _p->typed; int accepted_count = 0; const Variant *argptrs[1]; |