mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Reduce and prevent unnecessary random-access to List
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when accessing a single element) * Removed subscript operator, in favor of a more explicit `get` * Added conversion from `Iterator` to `ConstIterator` * Remade existing operations into other solutions when applicable
This commit is contained in:
parent
7ebc866418
commit
955d5affa8
103 changed files with 877 additions and 849 deletions
|
@ -241,9 +241,9 @@ static bool _can_use_validate_call(const MethodBind *p_method, const Vector<GDSc
|
|||
}
|
||||
MethodInfo info;
|
||||
ClassDB::get_method_info(p_method->get_instance_class(), p_method->get_name(), &info);
|
||||
for (int i = 0; i < p_arguments.size(); i++) {
|
||||
const PropertyInfo &prop = info.arguments[i];
|
||||
if (!_is_exact_type(prop, p_arguments[i].type)) {
|
||||
int i = 0;
|
||||
for (List<PropertyInfo>::ConstIterator itr = info.arguments.begin(); itr != info.arguments.end(); ++itr, ++i) {
|
||||
if (!_is_exact_type(*itr, p_arguments[i].type)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue