summaryrefslogtreecommitdiff
path: root/editor/plugins/asset_library_editor_plugin.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-09-30 23:52:46 +0200
committerGitHub <noreply@github.com>2021-09-30 23:52:46 +0200
commit77721b35ba21f2e7e8bb42cf415fccb018517843 (patch)
tree96b8f7532ae5d923b75bfbac8d6763015b6646bb /editor/plugins/asset_library_editor_plugin.cpp
parent3e1b6304613855cad56938e8a58848f09363a298 (diff)
parentc63b18507d21b8a213c073bced9057b571cdcd7a (diff)
Merge pull request #51409 from LightningAA/use-map-iterators
Use range iterators for `Map` in most cases
Diffstat (limited to 'editor/plugins/asset_library_editor_plugin.cpp')
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index 664b2f521e..aacfc3e305 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -830,9 +830,9 @@ void EditorAssetLibrary::_update_image_queue() {
int current_images = 0;
List<int> to_delete;
- for (Map<int, ImageQueue>::Element *E = image_queue.front(); E; E = E->next()) {
- if (!E->get().active && current_images < max_images) {
- String cache_filename_base = EditorPaths::get_singleton()->get_cache_dir().plus_file("assetimage_" + E->get().image_url.md5_text());
+ for (KeyValue<int, ImageQueue> &E : image_queue) {
+ if (!E.value.active && current_images < max_images) {
+ String cache_filename_base = EditorPaths::get_singleton()->get_cache_dir().plus_file("assetimage_" + E.value.image_url.md5_text());
Vector<String> headers;
if (FileAccess::exists(cache_filename_base + ".etag") && FileAccess::exists(cache_filename_base + ".data")) {
@@ -844,14 +844,14 @@ void EditorAssetLibrary::_update_image_queue() {
}
}
- Error err = E->get().request->request(E->get().image_url, headers);
+ Error err = E.value.request->request(E.value.image_url, headers);
if (err != OK) {
- to_delete.push_back(E->key());
+ to_delete.push_back(E.key);
} else {
- E->get().active = true;
+ E.value.active = true;
}
current_images++;
- } else if (E->get().active) {
+ } else if (E.value.active) {
current_images++;
}
}