You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Move bisect to Span and deduplicate code.
Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
This commit is contained in:
@@ -34,7 +34,6 @@
|
||||
#include "core/math/math_funcs.h"
|
||||
#include "core/object/script_language.h"
|
||||
#include "core/templates/hashfuncs.h"
|
||||
#include "core/templates/search_array.h"
|
||||
#include "core/templates/vector.h"
|
||||
#include "core/variant/callable.h"
|
||||
#include "core/variant/dictionary.h"
|
||||
@@ -737,8 +736,7 @@ void Array::shuffle() {
|
||||
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.ptr(), _p->array.size(), value, p_before);
|
||||
return _p->array.span().bisect<_ArrayVariantSort>(value, p_before);
|
||||
}
|
||||
|
||||
int Array::bsearch_custom(const Variant &p_value, const Callable &p_callable, bool p_before) const {
|
||||
|
||||
Reference in New Issue
Block a user