You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +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:
@@ -687,8 +687,8 @@ void ShaderRD::enable_group(int p_group) {
|
||||
// Compile all versions again to include the new group.
|
||||
List<RID> all_versions;
|
||||
version_owner.get_owned_list(&all_versions);
|
||||
for (int i = 0; i < all_versions.size(); i++) {
|
||||
Version *version = version_owner.get_or_null(all_versions[i]);
|
||||
for (const RID &E : all_versions) {
|
||||
Version *version = version_owner.get_or_null(E);
|
||||
_compile_version(version, p_group);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user