diff options
author | Juan Linietsky <reduzio@gmail.com> | 2016-07-24 12:21:29 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-24 12:21:29 -0300 |
commit | c9d005375446c80cab2fb226d92e6b212b10faac (patch) | |
tree | a0e6c99bd6956a5905e792c6e1fae460e188cc53 /core/array.cpp | |
parent | ba625a14c64e451be46a18fb2e6ee37a7d2aa24b (diff) | |
parent | 96eb97cbbf8acd38a44ecb914e12aeda322d0bd4 (diff) |
Merge pull request #5524 from pkowal1982/master
Array has(var value) function
Diffstat (limited to 'core/array.cpp')
-rw-r--r-- | core/array.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/array.cpp b/core/array.cpp index bb8e527304..23792f90fc 100644 --- a/core/array.cpp +++ b/core/array.cpp @@ -200,6 +200,10 @@ int Array::count(const Variant& p_value) const { return amount; } +bool Array::has(const Variant& p_value) const { + return _p->array.find(p_value, 0) != -1; +} + void Array::remove(int p_pos) { _p->array.remove(p_pos); |