summaryrefslogtreecommitdiffstats
path: root/core/variant/array.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-04-28 16:52:31 +0200
committerGitHub <noreply@github.com>2021-04-28 16:52:31 +0200
commit9e9ac9f6ad470be968233a021f54744ad4735c54 (patch)
treed3d13d411e24a280fde7e6c3b0b818134891c41d /core/variant/array.cpp
parentf505a2679808ddb95a552d9ad8ce9a0f9aa3b285 (diff)
parentefd27a63c138ceef89d4ed2586651ea61898f5c7 (diff)
downloadredot-engine-9e9ac9f6ad470be968233a021f54744ad4735c54.tar.gz
Merge pull request #46476 from DarknessCatt/master
Add fill method to Arrays and PackedArrays
Diffstat (limited to 'core/variant/array.cpp')
-rw-r--r--core/variant/array.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/core/variant/array.cpp b/core/variant/array.cpp
index 2ad728ec5e..2fb2dd4a30 100644
--- a/core/variant/array.cpp
+++ b/core/variant/array.cpp
@@ -208,6 +208,11 @@ void Array::insert(int p_pos, const Variant &p_value) {
_p->array.insert(p_pos, p_value);
}
+void Array::fill(const Variant &p_value) {
+ ERR_FAIL_COND(!_p->typed.validate(p_value, "fill"));
+ _p->array.fill(p_value);
+}
+
void Array::erase(const Variant &p_value) {
ERR_FAIL_COND(!_p->typed.validate(p_value, "erase"));
_p->array.erase(p_value);