Move bisect to Span and deduplicate code.
Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
This commit is contained in:
@ -40,7 +40,6 @@
|
||||
|
||||
#include "core/error/error_macros.h"
|
||||
#include "core/templates/cowdata.h"
|
||||
#include "core/templates/search_array.h"
|
||||
#include "core/templates/sort_array.h"
|
||||
|
||||
#include <initializer_list>
|
||||
@ -152,8 +151,7 @@ public:
|
||||
|
||||
template <typename Comparator, typename Value, typename... Args>
|
||||
Size bsearch_custom(const Value &p_value, bool p_before, Args &&...args) {
|
||||
SearchArray<T, Comparator> search{ args... };
|
||||
return search.bisect(ptrw(), size(), p_value, p_before);
|
||||
return span().bisect(p_value, p_before, Comparator{ args... });
|
||||
}
|
||||
|
||||
Vector<T> duplicate() {
|
||||
|
||||
Reference in New Issue
Block a user