diff options
author | mashumafi <mashumafi@gmail.com> | 2021-03-27 00:49:39 -0400 |
---|---|---|
committer | mashumafi <mashumafi@gmail.com> | 2021-03-27 17:27:19 -0400 |
commit | c2d1c1c3ee0ef9175ac70271205723061331a242 (patch) | |
tree | 0d9d3a957b018a9df176da8dc1939a9c3350bd2f /core/variant/array.cpp | |
parent | 5cdd4ee8bced19a5f7e74c6d3d693bbb39e27bd7 (diff) | |
download | redot-engine-c2d1c1c3ee0ef9175ac70271205723061331a242.tar.gz |
Array::insert consistent with Pool*Array::insert
Diffstat (limited to 'core/variant/array.cpp')
-rw-r--r-- | core/variant/array.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/variant/array.cpp b/core/variant/array.cpp index 347c6cd82e..c8fc19b43f 100644 --- a/core/variant/array.cpp +++ b/core/variant/array.cpp @@ -202,9 +202,9 @@ Error Array::resize(int p_new_size) { return _p->array.resize(p_new_size); } -void Array::insert(int p_pos, const Variant &p_value) { - ERR_FAIL_COND(!_p->typed.validate(p_value, "insert")); - _p->array.insert(p_pos, p_value); +Error Array::insert(int p_pos, const Variant &p_value) { + ERR_FAIL_COND_V(!_p->typed.validate(p_value, "insert"), ERR_INVALID_PARAMETER); + return _p->array.insert(p_pos, p_value); } void Array::erase(const Variant &p_value) { |