summaryrefslogtreecommitdiff
path: root/core/array.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/array.cpp')
-rw-r--r--core/array.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/core/array.cpp b/core/array.cpp
index d1c0688e63..3c6c8e768b 100644
--- a/core/array.cpp
+++ b/core/array.cpp
@@ -330,9 +330,8 @@ struct _ArrayVariantSort {
}
};
-Array &Array::sort() {
+void Array::sort() {
_p->array.sort_custom<_ArrayVariantSort>();
- return *this;
}
struct _ArrayVariantSortCustom {
@@ -349,14 +348,13 @@ struct _ArrayVariantSortCustom {
return res;
}
};
-Array &Array::sort_custom(Object *p_obj, const StringName &p_function) {
- ERR_FAIL_NULL_V(p_obj, *this);
+void Array::sort_custom(Object *p_obj, const StringName &p_function) {
+ ERR_FAIL_NULL(p_obj);
SortArray<Variant, _ArrayVariantSortCustom, true> avs;
avs.compare.obj = p_obj;
avs.compare.func = p_function;
avs.sort(_p->array.ptrw(), _p->array.size());
- return *this;
}
void Array::shuffle() {
@@ -415,9 +413,8 @@ int Array::bsearch_custom(const Variant &p_value, Object *p_obj, const StringNam
return bisect(_p->array, p_value, p_before, less);
}
-Array &Array::invert() {
+void Array::invert() {
_p->array.invert();
- return *this;
}
void Array::push_front(const Variant &p_value) {