summaryrefslogtreecommitdiffstats
path: root/core/variant/array.cpp
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2023-01-20 20:18:56 +0100
committerRaul Santos <raulsntos@gmail.com>2023-01-30 05:41:53 +0100
commit54f8fb010c28ac0ce594a53a61ebdb8a645ce1db (patch)
tree3b82a5fdf05d24ac5f4e387a1a3a1cef98168e71 /core/variant/array.cpp
parentd01ac9c73686fdf86f083f4d3ee1301bb54d855f (diff)
downloadredot-engine-54f8fb010c28ac0ce594a53a61ebdb8a645ce1db.tar.gz
Sync C# Array with Core
- Add `AddRange` method. - Add `Fill` method. - Add `Max` and `Min` methods. - Add `PickRandom` method. - Add `Reverse` method. - Add `RecursiveEqual` method. - Add `Sort` method. - Add `Slice` and `GetSliceRange` methods. - Add `IndexOf` overload that takes an index parameter. - Add `LastIndexOf` method. - Add `BinarySearch` method. - Add/update documentation.
Diffstat (limited to 'core/variant/array.cpp')
-rw-r--r--core/variant/array.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/variant/array.cpp b/core/variant/array.cpp
index 94d1596514..c38af726bd 100644
--- a/core/variant/array.cpp
+++ b/core/variant/array.cpp
@@ -612,14 +612,14 @@ void Array::shuffle() {
}
}
-int Array::bsearch(const Variant &p_value, bool p_before) {
+int Array::bsearch(const Variant &p_value, bool p_before) const {
Variant value = p_value;
ERR_FAIL_COND_V(!_p->typed.validate(value, "binary search"), -1);
SearchArray<Variant, _ArrayVariantSort> avs;
return avs.bisect(_p->array.ptrw(), _p->array.size(), value, p_before);
}
-int Array::bsearch_custom(const Variant &p_value, const Callable &p_callable, bool p_before) {
+int Array::bsearch_custom(const Variant &p_value, const Callable &p_callable, bool p_before) const {
Variant value = p_value;
ERR_FAIL_COND_V(!_p->typed.validate(value, "custom binary search"), -1);