mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Reuse and optimize sorting logic for List, SelfList, and HashMap
Added SortList class, and updated List, SelfList, and HashMap sort methods to use it. Sorting is done with merge sort, with an initial check to optimize for already sorted lists, and sorted lists that were appended to.
This commit is contained in:
parent
1b37dacc18
commit
6b2674fe18
10 changed files with 309 additions and 190 deletions
|
|
@ -4009,7 +4009,7 @@ bool BindingsGenerator::_populate_object_type_interfaces() {
|
|||
|
||||
List<Pair<MethodInfo, uint32_t>> method_list_with_hashes;
|
||||
ClassDB::get_method_list_with_compatibility(type_cname, &method_list_with_hashes, true);
|
||||
method_list_with_hashes.sort_custom_inplace<SortMethodWithHashes>();
|
||||
method_list_with_hashes.sort_custom<SortMethodWithHashes>();
|
||||
|
||||
List<MethodInterface> compat_methods;
|
||||
for (const Pair<MethodInfo, uint32_t> &E : method_list_with_hashes) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue