You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +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:
@@ -90,8 +90,8 @@ void ResourcePreloaderEditor::_load_pressed() {
|
||||
file->clear_filters();
|
||||
List<String> extensions;
|
||||
ResourceLoader::get_recognized_extensions_for_type("", &extensions);
|
||||
for (int i = 0; i < extensions.size(); i++) {
|
||||
file->add_filter("*." + extensions[i]);
|
||||
for (const String &extension : extensions) {
|
||||
file->add_filter("*." + extension);
|
||||
}
|
||||
|
||||
file->set_file_mode(EditorFileDialog::FILE_MODE_OPEN_FILES);
|
||||
|
||||
Reference in New Issue
Block a user