1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Do not use Dictionary::keys() for Dictionary iteration.

This commit is contained in:
Yufeng Ying
2025-03-21 20:06:01 +08:00
parent 4b36c0491e
commit 8ae16699c5
18 changed files with 78 additions and 102 deletions

View File

@@ -463,17 +463,16 @@ void DependencyRemoveDialog::_find_localization_remaps_of_removed_files(Vector<R
p_removed.push_back(dep);
}
Array remap_keys = remaps.keys();
for (int j = 0; j < remap_keys.size(); j++) {
PackedStringArray remapped_files = remaps[remap_keys[j]];
for (int k = 0; k < remapped_files.size(); k++) {
int splitter_pos = remapped_files[k].rfind_char(':');
String res_path = remapped_files[k].substr(0, splitter_pos);
for (const KeyValue<Variant, Variant> &remap_kv : remaps) {
PackedStringArray remapped_files = remap_kv.value;
for (const String &remapped_file : remapped_files) {
int splitter_pos = remapped_file.rfind_char(':');
String res_path = remapped_file.substr(0, splitter_pos);
if (res_path == path) {
String locale_name = remapped_files[k].substr(splitter_pos + 1);
String locale_name = remapped_file.substr(splitter_pos + 1);
RemovedDependency dep;
dep.file = vformat(TTR("Localization remap for path '%s' and locale '%s'."), remap_keys[j], locale_name);
dep.file = vformat(TTR("Localization remap for path '%s' and locale '%s'."), remap_kv.key, locale_name);
dep.file_type = "";
dep.dependency = path;
dep.dependency_folder = files.value;