summaryrefslogtreecommitdiff
path: root/core/array.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/array.cpp')
-rw-r--r--core/array.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/core/array.cpp b/core/array.cpp
index d1c0688e63..c6e90d71ec 100644
--- a/core/array.cpp
+++ b/core/array.cpp
@@ -31,8 +31,8 @@
#include "array.h"
#include "container_type_validate.h"
+#include "core/class_db.h"
#include "core/hashfuncs.h"
-#include "core/object.h"
#include "core/script_language.h"
#include "core/variant.h"
#include "core/vector.h"
@@ -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) {