Skip to content

Commit

Permalink
Merge pull request #67103 from Mickeon/i-forgor
Browse files Browse the repository at this point in the history
Fix Array.`slice()` and `filter()` forgetting Typed Array
  • Loading branch information
akien-mga committed Oct 9, 2022
2 parents 629fa41 + bf64a06 commit ca25c6e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/variant/array.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.");

Expand Down Expand Up @@ -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];
Expand Down

0 comments on commit ca25c6e

Please sign in to comment.