mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Move bisect to Span and deduplicate code.
Co-authored-by: Lukas Tenbrink <lukas.tenbrink@gmail.com>
This commit is contained in:
parent
09fcbb8645
commit
3bf400ffae
9 changed files with 113 additions and 108 deletions
|
|
@ -178,10 +178,8 @@ static void merge_methods(Vector<DocData::MethodDoc> &p_to, const Vector<DocData
|
|||
DocData::MethodDoc *to_ptrw = p_to.ptrw();
|
||||
int64_t to_size = p_to.size();
|
||||
|
||||
SearchArray<DocData::MethodDoc, MethodCompare> search_array;
|
||||
|
||||
for (const DocData::MethodDoc &from : p_from) {
|
||||
int64_t found = search_array.bisect(to_ptrw, to_size, from, true);
|
||||
int64_t found = p_to.span().bisect<MethodCompare>(from, true);
|
||||
|
||||
if (found >= to_size) {
|
||||
continue;
|
||||
|
|
@ -206,10 +204,8 @@ static void merge_constants(Vector<DocData::ConstantDoc> &p_to, const Vector<Doc
|
|||
const DocData::ConstantDoc *from_ptr = p_from.ptr();
|
||||
int64_t from_size = p_from.size();
|
||||
|
||||
SearchArray<DocData::ConstantDoc> search_array;
|
||||
|
||||
for (DocData::ConstantDoc &to : p_to) {
|
||||
int64_t found = search_array.bisect(from_ptr, from_size, to, true);
|
||||
int64_t found = p_from.span().bisect(to, true);
|
||||
|
||||
if (found >= from_size) {
|
||||
continue;
|
||||
|
|
@ -234,10 +230,8 @@ static void merge_properties(Vector<DocData::PropertyDoc> &p_to, const Vector<Do
|
|||
DocData::PropertyDoc *to_ptrw = p_to.ptrw();
|
||||
int64_t to_size = p_to.size();
|
||||
|
||||
SearchArray<DocData::PropertyDoc> search_array;
|
||||
|
||||
for (const DocData::PropertyDoc &from : p_from) {
|
||||
int64_t found = search_array.bisect(to_ptrw, to_size, from, true);
|
||||
int64_t found = p_to.span().bisect(from, true);
|
||||
|
||||
if (found >= to_size) {
|
||||
continue;
|
||||
|
|
@ -262,10 +256,8 @@ static void merge_theme_properties(Vector<DocData::ThemeItemDoc> &p_to, const Ve
|
|||
DocData::ThemeItemDoc *to_ptrw = p_to.ptrw();
|
||||
int64_t to_size = p_to.size();
|
||||
|
||||
SearchArray<DocData::ThemeItemDoc> search_array;
|
||||
|
||||
for (const DocData::ThemeItemDoc &from : p_from) {
|
||||
int64_t found = search_array.bisect(to_ptrw, to_size, from, true);
|
||||
int64_t found = p_to.span().bisect(from, true);
|
||||
|
||||
if (found >= to_size) {
|
||||
continue;
|
||||
|
|
@ -290,10 +282,8 @@ static void merge_operators(Vector<DocData::MethodDoc> &p_to, const Vector<DocDa
|
|||
DocData::MethodDoc *to_ptrw = p_to.ptrw();
|
||||
int64_t to_size = p_to.size();
|
||||
|
||||
SearchArray<DocData::MethodDoc, OperatorCompare> search_array;
|
||||
|
||||
for (const DocData::MethodDoc &from : p_from) {
|
||||
int64_t found = search_array.bisect(to_ptrw, to_size, from, true);
|
||||
int64_t found = p_to.span().bisect(from, true);
|
||||
|
||||
if (found >= to_size) {
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue