2
0
Эх сурвалжийг харах

Using iterator pattern instead of List::Element *.

Co-authored-by: Adam Scott <[email protected]>
Yyf2333 5 сар өмнө
parent
commit
22b5ec17fb
36 өөрчлөгдсөн 150 нэмэгдсэн , 173 устгасан
  1. 2 2
      core/config/project_settings.cpp
  2. 4 4
      core/core_bind.cpp
  3. 4 4
      core/extension/extension_api_dump.cpp
  4. 1 3
      core/math/geometry_2d.cpp
  5. 2 2
      core/object/object.cpp
  6. 1 2
      core/string/translation_po.cpp
  7. 2 2
      drivers/gles3/storage/texture_storage.cpp
  8. 2 2
      editor/animation_track_editor.cpp
  9. 2 2
      editor/connections_dialog.cpp
  10. 2 4
      editor/create_dialog.cpp
  11. 1 3
      editor/debugger/debug_adapter/debug_adapter_parser.cpp
  12. 32 36
      editor/debugger/debug_adapter/debug_adapter_protocol.cpp
  13. 6 6
      editor/doc_tools.cpp
  14. 1 2
      editor/editor_data.cpp
  15. 4 4
      editor/editor_file_system.cpp
  16. 1 3
      editor/editor_inspector.cpp
  17. 4 4
      editor/import/3d/editor_import_collada.cpp
  18. 9 10
      editor/import/dynamic_font_import_settings.cpp
  19. 3 3
      editor/import/resource_importer_bmfont.cpp
  20. 7 7
      editor/plugins/animation_state_machine_editor.cpp
  21. 4 4
      editor/plugins/tiles/tile_set_atlas_source_editor.cpp
  22. 2 4
      editor/plugins/version_control_editor_plugin.cpp
  23. 2 2
      editor/plugins/visual_shader_editor_plugin.cpp
  24. 2 2
      editor/project_manager.cpp
  25. 2 2
      modules/enet/enet_connection.cpp
  26. 2 2
      modules/gdscript/gdscript_editor.cpp
  27. 2 2
      modules/gdscript/language_server/gdscript_workspace.cpp
  28. 4 4
      modules/gdscript/language_server/godot_lsp.h
  29. 1 3
      modules/navigation/2d/nav_mesh_generator_2d.cpp
  30. 1 2
      scene/animation/animation_player.cpp
  31. 5 5
      scene/main/node.cpp
  32. 1 3
      scene/resources/2d/navigation_polygon.cpp
  33. 3 4
      scene/resources/3d/primitive_meshes.cpp
  34. 18 18
      scene/resources/material.cpp
  35. 9 9
      scene/resources/resource_format_text.cpp
  36. 2 2
      servers/rendering/renderer_rd/storage_rd/texture_storage.cpp

+ 2 - 2
core/config/project_settings.cpp

@@ -1434,8 +1434,8 @@ void ProjectSettings::_add_builtin_input_map() {
 			Array events;
 			Array events;
 
 
 			// Convert list of input events into array
 			// Convert list of input events into array
-			for (List<Ref<InputEvent>>::Element *I = E.value.front(); I; I = I->next()) {
-				events.push_back(I->get());
+			for (const Ref<InputEvent> &event : E.value) {
+				events.push_back(event);
 			}
 			}
 
 
 			Dictionary action;
 			Dictionary action;

+ 4 - 4
core/core_bind.cpp

@@ -466,8 +466,8 @@ bool OS::is_restart_on_exit_set() const {
 Vector<String> OS::get_restart_on_exit_arguments() const {
 Vector<String> OS::get_restart_on_exit_arguments() const {
 	List<String> args = ::OS::get_singleton()->get_restart_on_exit_arguments();
 	List<String> args = ::OS::get_singleton()->get_restart_on_exit_arguments();
 	Vector<String> args_vector;
 	Vector<String> args_vector;
-	for (List<String>::Element *E = args.front(); E; E = E->next()) {
-		args_vector.push_back(E->get());
+	for (const String &arg : args) {
+		args_vector.push_back(arg);
 	}
 	}
 
 
 	return args_vector;
 	return args_vector;
@@ -1879,8 +1879,8 @@ Vector<String> Engine::get_singleton_list() const {
 	List<::Engine::Singleton> singletons;
 	List<::Engine::Singleton> singletons;
 	::Engine::get_singleton()->get_singletons(&singletons);
 	::Engine::get_singleton()->get_singletons(&singletons);
 	Vector<String> ret;
 	Vector<String> ret;
-	for (List<::Engine::Singleton>::Element *E = singletons.front(); E; E = E->next()) {
-		ret.push_back(E->get().name);
+	for (const ::Engine::Singleton &E : singletons) {
+		ret.push_back(E.name);
 	}
 	}
 	return ret;
 	return ret;
 }
 }

+ 4 - 4
core/extension/extension_api_dump.cpp

@@ -975,14 +975,14 @@ Dictionary GDExtensionAPIDump::generate_extension_api(bool p_include_docs) {
 					Array values;
 					Array values;
 					List<StringName> enum_constant_list;
 					List<StringName> enum_constant_list;
 					ClassDB::get_enum_constants(class_name, F, &enum_constant_list, true);
 					ClassDB::get_enum_constants(class_name, F, &enum_constant_list, true);
-					for (List<StringName>::Element *G = enum_constant_list.front(); G; G = G->next()) {
+					for (const StringName &enum_constant : enum_constant_list) {
 						Dictionary d3;
 						Dictionary d3;
-						d3["name"] = String(G->get());
-						d3["value"] = ClassDB::get_integer_constant(class_name, G->get());
+						d3["name"] = String(enum_constant);
+						d3["value"] = ClassDB::get_integer_constant(class_name, enum_constant);
 
 
 						if (p_include_docs) {
 						if (p_include_docs) {
 							for (const DocData::ConstantDoc &constant_doc : class_doc->constants) {
 							for (const DocData::ConstantDoc &constant_doc : class_doc->constants) {
-								if (constant_doc.name == G->get()) {
+								if (constant_doc.name == enum_constant) {
 									d3["description"] = fix_doc_description(constant_doc.description);
 									d3["description"] = fix_doc_description(constant_doc.description);
 									break;
 									break;
 								}
 								}

+ 1 - 3
core/math/geometry_2d.cpp

@@ -103,9 +103,7 @@ Vector<Vector<Vector2>> Geometry2D::decompose_many_polygons_in_convex(const Vect
 
 
 	decomp.resize(out_poly.size());
 	decomp.resize(out_poly.size());
 	int idx = 0;
 	int idx = 0;
-	for (List<TPPLPoly>::Element *I = out_poly.front(); I; I = I->next()) {
-		TPPLPoly &tp = I->get();
-
+	for (TPPLPoly &tp : out_poly) {
 		decomp.write[idx].resize(tp.GetNumPoints());
 		decomp.write[idx].resize(tp.GetNumPoints());
 
 
 		for (int64_t i = 0; i < tp.GetNumPoints(); i++) {
 		for (int64_t i = 0; i < tp.GetNumPoints(); i++) {

+ 2 - 2
core/object/object.cpp

@@ -1089,8 +1089,8 @@ TypedArray<Dictionary> Object::_get_method_list_bind() const {
 	get_method_list(&ml);
 	get_method_list(&ml);
 	TypedArray<Dictionary> ret;
 	TypedArray<Dictionary> ret;
 
 
-	for (List<MethodInfo>::Element *E = ml.front(); E; E = E->next()) {
-		Dictionary d = E->get();
+	for (const MethodInfo &mi : ml) {
+		Dictionary d = mi;
 		//va.push_back(d);
 		//va.push_back(d);
 		ret.push_back(d);
 		ret.push_back(d);
 	}
 	}

+ 1 - 2
core/string/translation_po.cpp

@@ -53,8 +53,7 @@ void TranslationPO::print_translation_map() {
 
 
 		List<StringName> id_l;
 		List<StringName> id_l;
 		inner_map.get_key_list(&id_l);
 		inner_map.get_key_list(&id_l);
-		for (List<StringName>::Element *E2 = id_l.front(); E2; E2 = E2->next()) {
-			StringName id = E2->get();
+		for (const StringName &id : id_l) {
 			file->store_line("msgid: " + String::utf8(String(id).utf8()));
 			file->store_line("msgid: " + String::utf8(String(id).utf8()));
 			for (int i = 0; i < inner_map[id].size(); i++) {
 			for (int i = 0; i < inner_map[id].size(); i++) {
 				file->store_line("msgstr[" + String::num_int64(i) + "]: " + String::utf8(String(inner_map[id][i]).utf8()));
 				file->store_line("msgstr[" + String::num_int64(i) + "]: " + String::utf8(String(inner_map[id][i]).utf8()));

+ 2 - 2
drivers/gles3/storage/texture_storage.cpp

@@ -1468,8 +1468,8 @@ void TextureStorage::texture_debug_usage(List<RS::TextureInfo> *r_info) {
 	List<RID> textures;
 	List<RID> textures;
 	texture_owner.get_owned_list(&textures);
 	texture_owner.get_owned_list(&textures);
 
 
-	for (List<RID>::Element *E = textures.front(); E; E = E->next()) {
-		Texture *t = texture_owner.get_or_null(E->get());
+	for (const RID &rid : textures) {
+		Texture *t = texture_owner.get_or_null(rid);
 		if (!t) {
 		if (!t) {
 			continue;
 			continue;
 		}
 		}

+ 2 - 2
editor/animation_track_editor.cpp

@@ -1251,12 +1251,12 @@ void AnimationMultiTrackKeyEdit::_get_property_list(List<PropertyInfo> *p_list)
 					if (ap) {
 					if (ap) {
 						List<StringName> anims;
 						List<StringName> anims;
 						ap->get_animation_list(&anims);
 						ap->get_animation_list(&anims);
-						for (List<StringName>::Element *G = anims.front(); G; G = G->next()) {
+						for (const StringName &anim : anims) {
 							if (!animations.is_empty()) {
 							if (!animations.is_empty()) {
 								animations += ",";
 								animations += ",";
 							}
 							}
 
 
-							animations += String(G->get());
+							animations += String(anim);
 						}
 						}
 					}
 					}
 				}
 				}

+ 2 - 2
editor/connections_dialog.cpp

@@ -1463,8 +1463,8 @@ void ConnectionsDock::update_tree() {
 				List<MethodInfo> base_signals;
 				List<MethodInfo> base_signals;
 				base->get_script_signal_list(&base_signals);
 				base->get_script_signal_list(&base_signals);
 				HashSet<String> base_signal_names;
 				HashSet<String> base_signal_names;
-				for (List<MethodInfo>::Element *F = base_signals.front(); F; F = F->next()) {
-					base_signal_names.insert(F->get().name);
+				for (const MethodInfo &signal : base_signals) {
+					base_signal_names.insert(signal.name);
 				}
 				}
 				for (List<MethodInfo>::Element *F = class_signals.front(); F; F = F->next()) {
 				for (List<MethodInfo>::Element *F = class_signals.front(); F; F = F->next()) {
 					if (base_signal_names.has(F->get().name)) {
 					if (base_signal_names.has(F->get().name)) {

+ 2 - 4
editor/create_dialog.cpp

@@ -83,8 +83,7 @@ void CreateDialog::_fill_type_list() {
 
 
 	EditorData &ed = EditorNode::get_editor_data();
 	EditorData &ed = EditorNode::get_editor_data();
 
 
-	for (List<StringName>::Element *I = complete_type_list.front(); I; I = I->next()) {
-		StringName type = I->get();
+	for (const StringName &type : complete_type_list) {
 		if (!_should_hide_type(type)) {
 		if (!_should_hide_type(type)) {
 			type_list.push_back(type);
 			type_list.push_back(type);
 
 
@@ -216,8 +215,7 @@ void CreateDialog::_update_search() {
 	float highest_score = 0.0f;
 	float highest_score = 0.0f;
 	StringName best_match;
 	StringName best_match;
 
 
-	for (List<StringName>::Element *I = type_list.front(); I; I = I->next()) {
-		StringName candidate = I->get();
+	for (const StringName &candidate : type_list) {
 		if (empty_search || search_text.is_subsequence_ofn(candidate)) {
 		if (empty_search || search_text.is_subsequence_ofn(candidate)) {
 			_add_type(candidate, ClassDB::class_exists(candidate) ? TypeCategory::CPP_TYPE : TypeCategory::OTHER_TYPE);
 			_add_type(candidate, ClassDB::class_exists(candidate) ? TypeCategory::CPP_TYPE : TypeCategory::OTHER_TYPE);
 
 

+ 1 - 3
editor/debugger/debug_adapter/debug_adapter_parser.cpp

@@ -144,9 +144,7 @@ Dictionary DebugAdapterParser::req_initialize(const Dictionary &p_params) const
 		// Send all current breakpoints
 		// Send all current breakpoints
 		List<String> breakpoints;
 		List<String> breakpoints;
 		ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);
 		ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);
-		for (List<String>::Element *E = breakpoints.front(); E; E = E->next()) {
-			String breakpoint = E->get();
-
+		for (const String &breakpoint : breakpoints) {
 			String path = breakpoint.left(breakpoint.find_char(':', 6)); // Skip initial part of path, aka "res://"
 			String path = breakpoint.left(breakpoint.find_char(':', 6)); // Skip initial part of path, aka "res://"
 			int line = breakpoint.substr(path.size()).to_int();
 			int line = breakpoint.substr(path.size()).to_int();
 
 

+ 32 - 36
editor/debugger/debug_adapter/debug_adapter_protocol.cpp

@@ -906,66 +906,66 @@ void DebugAdapterProtocol::notify_process() {
 	String launch_mode = _current_peer->attached ? "attach" : "launch";
 	String launch_mode = _current_peer->attached ? "attach" : "launch";
 
 
 	Dictionary event = parser->ev_process(launch_mode);
 	Dictionary event = parser->ev_process(launch_mode);
-	for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
-		E->get()->res_queue.push_back(event);
+	for (const Ref<DAPeer> &peer : clients) {
+		peer->res_queue.push_back(event);
 	}
 	}
 }
 }
 
 
 void DebugAdapterProtocol::notify_terminated() {
 void DebugAdapterProtocol::notify_terminated() {
 	Dictionary event = parser->ev_terminated();
 	Dictionary event = parser->ev_terminated();
-	for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
-		if ((_current_request == "launch" || _current_request == "restart") && _current_peer == E->get()) {
+	for (const Ref<DAPeer> &peer : clients) {
+		if ((_current_request == "launch" || _current_request == "restart") && _current_peer == peer) {
 			continue;
 			continue;
 		}
 		}
-		E->get()->res_queue.push_back(event);
+		peer->res_queue.push_back(event);
 	}
 	}
 }
 }
 
 
 void DebugAdapterProtocol::notify_exited(const int &p_exitcode) {
 void DebugAdapterProtocol::notify_exited(const int &p_exitcode) {
 	Dictionary event = parser->ev_exited(p_exitcode);
 	Dictionary event = parser->ev_exited(p_exitcode);
-	for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
-		if ((_current_request == "launch" || _current_request == "restart") && _current_peer == E->get()) {
+	for (const Ref<DAPeer> &peer : clients) {
+		if ((_current_request == "launch" || _current_request == "restart") && _current_peer == peer) {
 			continue;
 			continue;
 		}
 		}
-		E->get()->res_queue.push_back(event);
+		peer->res_queue.push_back(event);
 	}
 	}
 }
 }
 
 
 void DebugAdapterProtocol::notify_stopped_paused() {
 void DebugAdapterProtocol::notify_stopped_paused() {
 	Dictionary event = parser->ev_stopped_paused();
 	Dictionary event = parser->ev_stopped_paused();
-	for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
-		E->get()->res_queue.push_back(event);
+	for (const Ref<DAPeer> &peer : clients) {
+		peer->res_queue.push_back(event);
 	}
 	}
 }
 }
 
 
 void DebugAdapterProtocol::notify_stopped_exception(const String &p_error) {
 void DebugAdapterProtocol::notify_stopped_exception(const String &p_error) {
 	Dictionary event = parser->ev_stopped_exception(p_error);
 	Dictionary event = parser->ev_stopped_exception(p_error);
-	for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
-		E->get()->res_queue.push_back(event);
+	for (const Ref<DAPeer> &peer : clients) {
+		peer->res_queue.push_back(event);
 	}
 	}
 }
 }
 
 
 void DebugAdapterProtocol::notify_stopped_breakpoint(const int &p_id) {
 void DebugAdapterProtocol::notify_stopped_breakpoint(const int &p_id) {
 	Dictionary event = parser->ev_stopped_breakpoint(p_id);
 	Dictionary event = parser->ev_stopped_breakpoint(p_id);
-	for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
-		E->get()->res_queue.push_back(event);
+	for (const Ref<DAPeer> &peer : clients) {
+		peer->res_queue.push_back(event);
 	}
 	}
 }
 }
 
 
 void DebugAdapterProtocol::notify_stopped_step() {
 void DebugAdapterProtocol::notify_stopped_step() {
 	Dictionary event = parser->ev_stopped_step();
 	Dictionary event = parser->ev_stopped_step();
-	for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
-		E->get()->res_queue.push_back(event);
+	for (const Ref<DAPeer> &peer : clients) {
+		peer->res_queue.push_back(event);
 	}
 	}
 }
 }
 
 
 void DebugAdapterProtocol::notify_continued() {
 void DebugAdapterProtocol::notify_continued() {
 	Dictionary event = parser->ev_continued();
 	Dictionary event = parser->ev_continued();
-	for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
-		if (_current_request == "continue" && E->get() == _current_peer) {
+	for (const Ref<DAPeer> &peer : clients) {
+		if (_current_request == "continue" && peer == _current_peer) {
 			continue;
 			continue;
 		}
 		}
-		E->get()->res_queue.push_back(event);
+		peer->res_queue.push_back(event);
 	}
 	}
 
 
 	reset_stack_info();
 	reset_stack_info();
@@ -973,15 +973,14 @@ void DebugAdapterProtocol::notify_continued() {
 
 
 void DebugAdapterProtocol::notify_output(const String &p_message, RemoteDebugger::MessageType p_type) {
 void DebugAdapterProtocol::notify_output(const String &p_message, RemoteDebugger::MessageType p_type) {
 	Dictionary event = parser->ev_output(p_message, p_type);
 	Dictionary event = parser->ev_output(p_message, p_type);
-	for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
-		E->get()->res_queue.push_back(event);
+	for (const Ref<DAPeer> &peer : clients) {
+		peer->res_queue.push_back(event);
 	}
 	}
 }
 }
 
 
 void DebugAdapterProtocol::notify_custom_data(const String &p_msg, const Array &p_data) {
 void DebugAdapterProtocol::notify_custom_data(const String &p_msg, const Array &p_data) {
 	Dictionary event = parser->ev_custom_data(p_msg, p_data);
 	Dictionary event = parser->ev_custom_data(p_msg, p_data);
-	for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
-		Ref<DAPeer> peer = E->get();
+	for (const Ref<DAPeer> &peer : clients) {
 		if (peer->supportsCustomData) {
 		if (peer->supportsCustomData) {
 			peer->res_queue.push_back(event);
 			peer->res_queue.push_back(event);
 		}
 		}
@@ -990,11 +989,11 @@ void DebugAdapterProtocol::notify_custom_data(const String &p_msg, const Array &
 
 
 void DebugAdapterProtocol::notify_breakpoint(const DAP::Breakpoint &p_breakpoint, const bool &p_enabled) {
 void DebugAdapterProtocol::notify_breakpoint(const DAP::Breakpoint &p_breakpoint, const bool &p_enabled) {
 	Dictionary event = parser->ev_breakpoint(p_breakpoint, p_enabled);
 	Dictionary event = parser->ev_breakpoint(p_breakpoint, p_enabled);
-	for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
-		if (_current_request == "setBreakpoints" && E->get() == _current_peer) {
+	for (const Ref<DAPeer> &peer : clients) {
+		if (_current_request == "setBreakpoints" && peer == _current_peer) {
 			continue;
 			continue;
 		}
 		}
-		E->get()->res_queue.push_back(event);
+		peer->res_queue.push_back(event);
 	}
 	}
 }
 }
 
 
@@ -1013,8 +1012,7 @@ Array DebugAdapterProtocol::update_breakpoints(const String &p_path, const Array
 	}
 	}
 
 
 	// Remove breakpoints
 	// Remove breakpoints
-	for (List<DAP::Breakpoint>::Element *E = breakpoint_list.front(); E; E = E->next()) {
-		DAP::Breakpoint b = E->get();
+	for (const DAP::Breakpoint &b : breakpoint_list) {
 		if (b.source.path == p_path && !p_lines.has(b.line)) {
 		if (b.source.path == p_path && !p_lines.has(b.line)) {
 			EditorDebuggerNode::get_singleton()->get_default_debugger()->_set_breakpoint(p_path, b.line, false);
 			EditorDebuggerNode::get_singleton()->get_default_debugger()->_set_breakpoint(p_path, b.line, false);
 		}
 		}
@@ -1133,8 +1131,7 @@ void DebugAdapterProtocol::on_debug_stack_frame_vars(const int &p_size) {
 	frame.id = _current_frame;
 	frame.id = _current_frame;
 	ERR_FAIL_COND(!stackframe_list.has(frame));
 	ERR_FAIL_COND(!stackframe_list.has(frame));
 	List<int> scope_ids = stackframe_list.find(frame)->value;
 	List<int> scope_ids = stackframe_list.find(frame)->value;
-	for (List<int>::Element *E = scope_ids.front(); E; E = E->next()) {
-		int var_id = E->get();
+	for (const int var_id : scope_ids) {
 		if (variable_list.has(var_id)) {
 		if (variable_list.has(var_id)) {
 			variable_list.find(var_id)->value.clear();
 			variable_list.find(var_id)->value.clear();
 		} else {
 		} else {
@@ -1195,8 +1192,7 @@ void DebugAdapterProtocol::poll() {
 		on_client_connected();
 		on_client_connected();
 	}
 	}
 	List<Ref<DAPeer>> to_delete;
 	List<Ref<DAPeer>> to_delete;
-	for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
-		Ref<DAPeer> peer = E->get();
+	for (const Ref<DAPeer> &peer : clients) {
 		peer->connection->poll();
 		peer->connection->poll();
 		StreamPeerTCP::Status status = peer->connection->get_status();
 		StreamPeerTCP::Status status = peer->connection->get_status();
 		if (status == StreamPeerTCP::STATUS_NONE || status == StreamPeerTCP::STATUS_ERROR) {
 		if (status == StreamPeerTCP::STATUS_NONE || status == StreamPeerTCP::STATUS_ERROR) {
@@ -1214,8 +1210,8 @@ void DebugAdapterProtocol::poll() {
 		}
 		}
 	}
 	}
 
 
-	for (List<Ref<DAPeer>>::Element *E = to_delete.front(); E; E = E->next()) {
-		on_client_disconnected(E->get());
+	for (const Ref<DAPeer> &peer : to_delete) {
+		on_client_disconnected(peer);
 	}
 	}
 	to_delete.clear();
 	to_delete.clear();
 }
 }
@@ -1228,8 +1224,8 @@ Error DebugAdapterProtocol::start(int p_port, const IPAddress &p_bind_ip) {
 }
 }
 
 
 void DebugAdapterProtocol::stop() {
 void DebugAdapterProtocol::stop() {
-	for (List<Ref<DAPeer>>::Element *E = clients.front(); E; E = E->next()) {
-		E->get()->connection->disconnect_from_host();
+	for (const Ref<DAPeer> &peer : clients) {
+		peer->connection->disconnect_from_host();
 	}
 	}
 
 
 	clients.clear();
 	clients.clear();

+ 6 - 6
editor/doc_tools.cpp

@@ -394,9 +394,9 @@ static Variant get_documentation_default_value(const StringName &p_class_name, c
 		// Cannot get default value of classes that can't be instantiated
 		// Cannot get default value of classes that can't be instantiated
 		List<StringName> inheriting_classes;
 		List<StringName> inheriting_classes;
 		ClassDB::get_direct_inheriters_from_class(p_class_name, &inheriting_classes);
 		ClassDB::get_direct_inheriters_from_class(p_class_name, &inheriting_classes);
-		for (List<StringName>::Element *E2 = inheriting_classes.front(); E2; E2 = E2->next()) {
-			if (ClassDB::can_instantiate(E2->get())) {
-				default_value = ClassDB::class_get_default_property_value(E2->get(), p_property_name, &r_default_value_valid);
+		for (const StringName &class_name : inheriting_classes) {
+			if (ClassDB::can_instantiate(class_name)) {
+				default_value = ClassDB::class_get_default_property_value(class_name, p_property_name, &r_default_value_valid);
 				if (r_default_value_valid) {
 				if (r_default_value_valid) {
 					break;
 					break;
 				}
 				}
@@ -657,10 +657,10 @@ void DocTools::generate(BitField<GenerateFlags> p_flags) {
 			ClassDB::get_signal_list(name, &signal_list, true);
 			ClassDB::get_signal_list(name, &signal_list, true);
 
 
 			if (signal_list.size()) {
 			if (signal_list.size()) {
-				for (List<MethodInfo>::Element *EV = signal_list.front(); EV; EV = EV->next()) {
+				for (const MethodInfo &mi : signal_list) {
 					DocData::MethodDoc signal;
 					DocData::MethodDoc signal;
-					signal.name = EV->get().name;
-					for (const PropertyInfo &arginfo : EV->get().arguments) {
+					signal.name = mi.name;
+					for (const PropertyInfo &arginfo : mi.arguments) {
 						DocData::ArgumentDoc argument;
 						DocData::ArgumentDoc argument;
 						DocData::argument_doc_from_arginfo(argument, arginfo);
 						DocData::argument_doc_from_arginfo(argument, arginfo);
 
 

+ 1 - 2
editor/editor_data.cpp

@@ -598,8 +598,7 @@ void EditorData::instantiate_object_properties(Object *p_object) {
 	List<PropertyInfo> pinfo;
 	List<PropertyInfo> pinfo;
 	p_object->get_property_list(&pinfo);
 	p_object->get_property_list(&pinfo);
 
 
-	for (List<PropertyInfo>::Element *E = pinfo.front(); E; E = E->next()) {
-		PropertyInfo pi = E->get();
+	for (const PropertyInfo &pi : pinfo) {
 		if (pi.type == Variant::OBJECT && pi.usage & PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT) {
 		if (pi.type == Variant::OBJECT && pi.usage & PROPERTY_USAGE_EDITOR_INSTANTIATE_OBJECT) {
 			Object *prop = ClassDB::instantiate(pi.class_name);
 			Object *prop = ClassDB::instantiate(pi.class_name);
 			p_object->set(pi.name, prop);
 			p_object->set(pi.name, prop);

+ 4 - 4
editor/editor_file_system.cpp

@@ -1151,15 +1151,15 @@ int EditorFileSystem::_scan_new_dir(ScannedDirectory *p_dir, Ref<DirAccess> &da)
 
 
 	int nb_files_total_scan = 0;
 	int nb_files_total_scan = 0;
 
 
-	for (List<String>::Element *E = dirs.front(); E; E = E->next()) {
-		if (da->change_dir(E->get()) == OK) {
+	for (const String &dir : dirs) {
+		if (da->change_dir(dir) == OK) {
 			String d = da->get_current_dir();
 			String d = da->get_current_dir();
 
 
 			if (d == cd || !d.begins_with(cd)) {
 			if (d == cd || !d.begins_with(cd)) {
 				da->change_dir(cd); //avoid recursion
 				da->change_dir(cd); //avoid recursion
 			} else {
 			} else {
 				ScannedDirectory *sd = memnew(ScannedDirectory);
 				ScannedDirectory *sd = memnew(ScannedDirectory);
-				sd->name = E->get();
+				sd->name = dir;
 				sd->full_path = p_dir->full_path.path_join(sd->name);
 				sd->full_path = p_dir->full_path.path_join(sd->name);
 
 
 				nb_files_total_scan += _scan_new_dir(sd, da);
 				nb_files_total_scan += _scan_new_dir(sd, da);
@@ -1169,7 +1169,7 @@ int EditorFileSystem::_scan_new_dir(ScannedDirectory *p_dir, Ref<DirAccess> &da)
 				da->change_dir("..");
 				da->change_dir("..");
 			}
 			}
 		} else {
 		} else {
-			ERR_PRINT("Cannot go into subdir '" + E->get() + "'.");
+			ERR_PRINT("Cannot go into subdir '" + dir + "'.");
 		}
 		}
 	}
 	}
 
 

+ 1 - 3
editor/editor_inspector.cpp

@@ -780,9 +780,7 @@ bool EditorProperty::use_keying_next() const {
 	List<PropertyInfo> plist;
 	List<PropertyInfo> plist;
 	object->get_property_list(&plist, true);
 	object->get_property_list(&plist, true);
 
 
-	for (List<PropertyInfo>::Element *I = plist.front(); I; I = I->next()) {
-		PropertyInfo &p = I->get();
-
+	for (const PropertyInfo &p : plist) {
 		if (p.name == property) {
 		if (p.name == property) {
 			return (p.usage & PROPERTY_USAGE_KEYING_INCREMENTS);
 			return (p.usage & PROPERTY_USAGE_KEYING_INCREMENTS);
 		}
 		}

+ 4 - 4
editor/import/3d/editor_import_collada.cpp

@@ -1642,22 +1642,22 @@ void ColladaImport::create_animation(int p_clip, bool p_import_value_tracks) {
 		}
 		}
 
 
 		for (int i = 0; i < snapshots.size(); i++) {
 		for (int i = 0; i < snapshots.size(); i++) {
-			for (List<int>::Element *ET = nm.anim_tracks.front(); ET; ET = ET->next()) {
+			for (const int track_id : nm.anim_tracks) {
 				//apply tracks
 				//apply tracks
 
 
 				if (p_clip == -1) {
 				if (p_clip == -1) {
-					if (track_filter.has(ET->get())) {
+					if (track_filter.has(track_id)) {
 						continue;
 						continue;
 					}
 					}
 				} else {
 				} else {
-					if (!track_filter.has(ET->get())) {
+					if (!track_filter.has(track_id)) {
 						continue;
 						continue;
 					}
 					}
 				}
 				}
 
 
 				found_anim = true;
 				found_anim = true;
 
 
-				const Collada::AnimationTrack &at = collada.state.animation_tracks[ET->get()];
+				const Collada::AnimationTrack &at = collada.state.animation_tracks[track_id];
 
 
 				int xform_idx = -1;
 				int xform_idx = -1;
 				for (int j = 0; j < cn->xform_list.size(); j++) {
 				for (int j = 0; j < cn->xform_list.size(); j++) {

+ 9 - 10
editor/import/dynamic_font_import_settings.cpp

@@ -533,8 +533,8 @@ void DynamicFontImportSettingsDialog::_variation_add() {
 	import_variation_data->owner = this;
 	import_variation_data->owner = this;
 	ERR_FAIL_COND(import_variation_data.is_null());
 	ERR_FAIL_COND(import_variation_data.is_null());
 
 
-	for (List<ResourceImporter::ImportOption>::Element *E = options_variations.front(); E; E = E->next()) {
-		import_variation_data->defaults[E->get().option.name] = E->get().default_value;
+	for (const ResourceImporter::ImportOption &option : options_variations) {
+		import_variation_data->defaults[option.option.name] = option.default_value;
 	}
 	}
 
 
 	import_variation_data->options = options_variations;
 	import_variation_data->options = options_variations;
@@ -1170,8 +1170,8 @@ void DynamicFontImportSettingsDialog::open_settings(const String &p_path) {
 
 
 	text_settings_data->owner = this;
 	text_settings_data->owner = this;
 
 
-	for (List<ResourceImporter::ImportOption>::Element *F = options_text.front(); F; F = F->next()) {
-		text_settings_data->defaults[F->get().option.name] = F->get().default_value;
+	for (const ResourceImporter::ImportOption &option : options_text) {
+		text_settings_data->defaults[option.option.name] = option.default_value;
 	}
 	}
 
 
 	text_settings_data->fd = font_main;
 	text_settings_data->fd = font_main;
@@ -1190,8 +1190,8 @@ void DynamicFontImportSettingsDialog::open_settings(const String &p_path) {
 
 
 	import_settings_data->settings.clear();
 	import_settings_data->settings.clear();
 	import_settings_data->defaults.clear();
 	import_settings_data->defaults.clear();
-	for (List<ResourceImporter::ImportOption>::Element *E = options_general.front(); E; E = E->next()) {
-		import_settings_data->defaults[E->get().option.name] = E->get().default_value;
+	for (const ResourceImporter::ImportOption &option : options_general) {
+		import_settings_data->defaults[option.option.name] = option.default_value;
 	}
 	}
 
 
 	Ref<ConfigFile> config;
 	Ref<ConfigFile> config;
@@ -1203,8 +1203,7 @@ void DynamicFontImportSettingsDialog::open_settings(const String &p_path) {
 	if (err == OK) {
 	if (err == OK) {
 		List<String> keys;
 		List<String> keys;
 		config->get_section_keys("params", &keys);
 		config->get_section_keys("params", &keys);
-		for (List<String>::Element *E = keys.front(); E; E = E->next()) {
-			String key = E->get();
+		for (const String &key : keys) {
 			print_verbose(String("    ") + key + " == " + String(config->get_value("params", key)));
 			print_verbose(String("    ") + key + " == " + String(config->get_value("params", key)));
 			if (key == "preload") {
 			if (key == "preload") {
 				Array preload_configurations = config->get_value("params", key);
 				Array preload_configurations = config->get_value("params", key);
@@ -1231,8 +1230,8 @@ void DynamicFontImportSettingsDialog::open_settings(const String &p_path) {
 					ERR_FAIL_COND(import_variation_data_custom.is_null());
 					ERR_FAIL_COND(import_variation_data_custom.is_null());
 
 
 					import_variation_data_custom->owner = this;
 					import_variation_data_custom->owner = this;
-					for (List<ResourceImporter::ImportOption>::Element *F = options_variations.front(); F; F = F->next()) {
-						import_variation_data_custom->defaults[F->get().option.name] = F->get().default_value;
+					for (const ResourceImporter::ImportOption &option : options_variations) {
+						import_variation_data_custom->defaults[option.option.name] = option.default_value;
 					}
 					}
 
 
 					import_variation_data_custom->fd = font_main;
 					import_variation_data_custom->fd = font_main;

+ 3 - 3
editor/import/resource_importer_bmfont.cpp

@@ -81,16 +81,16 @@ Error ResourceImporterBMFont::import(ResourceUID::ID p_source_id, const String &
 	ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot load font to file \"" + p_source_file + "\".");
 	ERR_FAIL_COND_V_MSG(err != OK, err, "Cannot load font to file \"" + p_source_file + "\".");
 
 
 	// Update import settings for the image files used by font.
 	// Update import settings for the image files used by font.
-	for (List<String>::Element *E = image_files.front(); E; E = E->next()) {
+	for (const String &file : image_files) {
 		Ref<ConfigFile> config;
 		Ref<ConfigFile> config;
 		config.instantiate();
 		config.instantiate();
 
 
-		err = config->load(E->get() + ".import");
+		err = config->load(file + ".import");
 		if (err == OK) {
 		if (err == OK) {
 			config->clear();
 			config->clear();
 			config->set_value("remap", "importer", "skip");
 			config->set_value("remap", "importer", "skip");
 
 
-			config->save(E->get() + ".import");
+			config->save(file + ".import");
 		}
 		}
 	}
 	}
 
 

+ 7 - 7
editor/plugins/animation_state_machine_editor.cpp

@@ -643,14 +643,14 @@ void AnimationNodeStateMachineEditor::_open_menu(const Vector2 &p_position) {
 	ClassDB::get_inheriters_from_class("AnimationRootNode", &classes);
 	ClassDB::get_inheriters_from_class("AnimationRootNode", &classes);
 	classes.sort_custom<StringName::AlphCompare>();
 	classes.sort_custom<StringName::AlphCompare>();
 
 
-	for (List<StringName>::Element *E = classes.front(); E; E = E->next()) {
-		String name = String(E->get()).replace_first("AnimationNode", "");
+	for (const StringName &class_name : classes) {
+		String name = String(class_name).replace_first("AnimationNode", "");
 		if (name == "Animation" || name == "StartState" || name == "EndState") {
 		if (name == "Animation" || name == "StartState" || name == "EndState") {
 			continue; // nope
 			continue; // nope
 		}
 		}
 		int idx = menu->get_item_count();
 		int idx = menu->get_item_count();
 		menu->add_item(vformat(TTR("Add %s"), name), idx);
 		menu->add_item(vformat(TTR("Add %s"), name), idx);
-		menu->set_item_metadata(idx, E->get());
+		menu->set_item_metadata(idx, class_name);
 	}
 	}
 	Ref<AnimationNode> clipb = EditorSettings::get_singleton()->get_resource_clipboard();
 	Ref<AnimationNode> clipb = EditorSettings::get_singleton()->get_resource_clipboard();
 
 
@@ -2019,16 +2019,16 @@ void EditorAnimationMultiTransitionEdit::_get_property_list(List<PropertyInfo> *
 		prop_transition_path.name = itos(i) + "/" + "transition_path";
 		prop_transition_path.name = itos(i) + "/" + "transition_path";
 		p_list->push_back(prop_transition_path);
 		p_list->push_back(prop_transition_path);
 
 
-		for (List<PropertyInfo>::Element *F = plist.front(); F; F = F->next()) {
-			if (F->get().name == "script" || F->get().name == "resource_name" || F->get().name == "resource_path" || F->get().name == "resource_local_to_scene") {
+		for (const PropertyInfo &pi : plist) {
+			if (pi.name == "script" || pi.name == "resource_name" || pi.name == "resource_path" || pi.name == "resource_local_to_scene") {
 				continue;
 				continue;
 			}
 			}
 
 
-			if (F->get().usage != PROPERTY_USAGE_DEFAULT) {
+			if (pi.usage != PROPERTY_USAGE_DEFAULT) {
 				continue;
 				continue;
 			}
 			}
 
 
-			PropertyInfo prop = F->get();
+			PropertyInfo prop = pi;
 			prop.name = itos(i) + "/" + prop.name;
 			prop.name = itos(i) + "/" + prop.name;
 
 
 			p_list->push_back(prop);
 			p_list->push_back(prop);

+ 4 - 4
editor/plugins/tiles/tile_set_atlas_source_editor.cpp

@@ -463,13 +463,13 @@ void TileSetAtlasSourceEditor::AtlasTileProxyObject::_get_property_list(List<Pro
 		tile_data->get_property_list(&list);
 		tile_data->get_property_list(&list);
 
 
 		HashMap<String, int> counts; // Counts the number of time a property appears (useful for groups that may appear more than once)
 		HashMap<String, int> counts; // Counts the number of time a property appears (useful for groups that may appear more than once)
-		for (List<PropertyInfo>::Element *E_property = list.front(); E_property; E_property = E_property->next()) {
+		for (const PropertyInfo &property : list) {
 			// Don't show category for TileData.
 			// Don't show category for TileData.
-			if (E_property->get().usage & PROPERTY_USAGE_CATEGORY) {
+			if (property.usage & PROPERTY_USAGE_CATEGORY) {
 				continue;
 				continue;
 			}
 			}
 
 
-			const String &property_string = E_property->get().name;
+			const String &property_string = property.name;
 			if (!tile_data->is_allowing_transform() && (property_string == "flip_h" || property_string == "flip_v" || property_string == "transpose")) {
 			if (!tile_data->is_allowing_transform() && (property_string == "flip_h" || property_string == "flip_v" || property_string == "transpose")) {
 				continue;
 				continue;
 			}
 			}
@@ -480,7 +480,7 @@ void TileSetAtlasSourceEditor::AtlasTileProxyObject::_get_property_list(List<Pro
 				counts[property_string] += 1;
 				counts[property_string] += 1;
 			}
 			}
 
 
-			PropertyInfo stored_property_info = E_property->get();
+			PropertyInfo stored_property_info = property;
 			stored_property_info.usage |= PROPERTY_USAGE_STORAGE; // Ignore the storage flag in comparing properties.
 			stored_property_info.usage |= PROPERTY_USAGE_STORAGE; // Ignore the storage flag in comparing properties.
 
 
 			PropertyId id = { counts[property_string], property_string };
 			PropertyId id = { counts[property_string], property_string };

+ 2 - 4
editor/plugins/version_control_editor_plugin.cpp

@@ -222,8 +222,7 @@ void VersionControlEditorPlugin::_refresh_commit_list() {
 
 
 	List<EditorVCSInterface::Commit> commit_info_list = EditorVCSInterface::get_singleton()->get_previous_commits(commit_list_size_button->get_selected_metadata());
 	List<EditorVCSInterface::Commit> commit_info_list = EditorVCSInterface::get_singleton()->get_previous_commits(commit_list_size_button->get_selected_metadata());
 
 
-	for (List<EditorVCSInterface::Commit>::Element *e = commit_info_list.front(); e; e = e->next()) {
-		EditorVCSInterface::Commit commit = e->get();
+	for (const EditorVCSInterface::Commit &commit : commit_info_list) {
 		TreeItem *item = commit_list->create_item();
 		TreeItem *item = commit_list->create_item();
 
 
 		// Only display the first line of a commit message
 		// Only display the first line of a commit message
@@ -370,8 +369,7 @@ void VersionControlEditorPlugin::_refresh_stage_area() {
 	unstaged_files->get_root()->clear_children();
 	unstaged_files->get_root()->clear_children();
 
 
 	List<EditorVCSInterface::StatusFile> status_files = EditorVCSInterface::get_singleton()->get_modified_files_data();
 	List<EditorVCSInterface::StatusFile> status_files = EditorVCSInterface::get_singleton()->get_modified_files_data();
-	for (List<EditorVCSInterface::StatusFile>::Element *E = status_files.front(); E; E = E->next()) {
-		EditorVCSInterface::StatusFile sf = E->get();
+	for (const EditorVCSInterface::StatusFile &sf : status_files) {
 		if (sf.area == EditorVCSInterface::TREE_AREA_STAGED) {
 		if (sf.area == EditorVCSInterface::TREE_AREA_STAGED) {
 			_add_new_item(staged_files, sf.file_path, sf.change_type);
 			_add_new_item(staged_files, sf.file_path, sf.change_type);
 		} else if (sf.area == EditorVCSInterface::TREE_AREA_UNSTAGED) {
 		} else if (sf.area == EditorVCSInterface::TREE_AREA_UNSTAGED) {

+ 2 - 2
editor/plugins/visual_shader_editor_plugin.cpp

@@ -4421,8 +4421,8 @@ void VisualShaderEditor::_delete_nodes(int p_type, const List<int> &p_nodes) {
 		for (const VisualShader::Connection &E : conns) {
 		for (const VisualShader::Connection &E : conns) {
 			if (E.from_node == F || E.to_node == F) {
 			if (E.from_node == F || E.to_node == F) {
 				bool cancel = false;
 				bool cancel = false;
-				for (List<VisualShader::Connection>::Element *R = used_conns.front(); R; R = R->next()) {
-					if (R->get().from_node == E.from_node && R->get().from_port == E.from_port && R->get().to_node == E.to_node && R->get().to_port == E.to_port) {
+				for (const VisualShader::Connection &R : used_conns) {
+					if (R.from_node == E.from_node && R.from_port == E.from_port && R.to_node == E.to_node && R.to_port == E.to_port) {
 						cancel = true; // to avoid ERR_ALREADY_EXISTS warning
 						cancel = true; // to avoid ERR_ALREADY_EXISTS warning
 						break;
 						break;
 					}
 					}

+ 2 - 2
editor/project_manager.cpp

@@ -142,8 +142,8 @@ void ProjectManager::_build_icon_type_cache(Ref<Theme> p_theme) {
 	}
 	}
 	List<StringName> tl;
 	List<StringName> tl;
 	p_theme->get_icon_list(EditorStringName(EditorIcons), &tl);
 	p_theme->get_icon_list(EditorStringName(EditorIcons), &tl);
-	for (List<StringName>::Element *E = tl.front(); E; E = E->next()) {
-		icon_type_cache[E->get()] = p_theme->get_icon(E->get(), EditorStringName(EditorIcons));
+	for (const StringName &name : tl) {
+		icon_type_cache[name] = p_theme->get_icon(name, EditorStringName(EditorIcons));
 	}
 	}
 }
 }
 
 

+ 2 - 2
modules/enet/enet_connection.cpp

@@ -72,8 +72,8 @@ Error ENetConnection::create_host(int p_max_peers, int p_max_channels, int p_in_
 
 
 void ENetConnection::destroy() {
 void ENetConnection::destroy() {
 	ERR_FAIL_NULL_MSG(host, "Host already destroyed.");
 	ERR_FAIL_NULL_MSG(host, "Host already destroyed.");
-	for (List<Ref<ENetPacketPeer>>::Element *E = peers.front(); E; E = E->next()) {
-		E->get()->_on_disconnect();
+	for (const Ref<ENetPacketPeer> &peer : peers) {
+		peer->_on_disconnect();
 	}
 	}
 	peers.clear();
 	peers.clear();
 	enet_host_destroy(host);
 	enet_host_destroy(host);

+ 2 - 2
modules/gdscript/gdscript_editor.cpp

@@ -1508,8 +1508,8 @@ static void _find_identifiers(const GDScriptParser::CompletionContext &p_context
 	List<StringName> utility_func_names;
 	List<StringName> utility_func_names;
 	Variant::get_utility_function_list(&utility_func_names);
 	Variant::get_utility_function_list(&utility_func_names);
 
 
-	for (List<StringName>::Element *E = utility_func_names.front(); E; E = E->next()) {
-		ScriptLanguage::CodeCompletionOption option(E->get(), ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION);
+	for (const StringName &util_func_name : utility_func_names) {
+		ScriptLanguage::CodeCompletionOption option(util_func_name, ScriptLanguage::CODE_COMPLETION_KIND_FUNCTION);
 		option.insert_text += "(";
 		option.insert_text += "(";
 		option.display += U"(\u2026)"; // As all utility functions contain an argument or more, this is hardcoded here.
 		option.display += U"(\u2026)"; // As all utility functions contain an argument or more, this is hardcoded here.
 		r_result.insert(option.display, option);
 		r_result.insert(option.display, option);

+ 2 - 2
modules/gdscript/language_server/gdscript_workspace.cpp

@@ -543,8 +543,8 @@ Vector<LSP::Location> GDScriptWorkspace::find_all_usages(const LSP::DocumentSymb
 	list_script_files("res://", paths);
 	list_script_files("res://", paths);
 
 
 	Vector<LSP::Location> usages;
 	Vector<LSP::Location> usages;
-	for (List<String>::Element *PE = paths.front(); PE; PE = PE->next()) {
-		usages.append_array(find_usages_in_file(p_symbol, PE->get()));
+	for (const String &path : paths) {
+		usages.append_array(find_usages_in_file(p_symbol, path));
 	}
 	}
 	return usages;
 	return usages;
 }
 }

+ 4 - 4
modules/gdscript/language_server/godot_lsp.h

@@ -1873,7 +1873,7 @@ struct GodotNativeClassInfo {
 	const DocData::ClassDoc *class_doc = nullptr;
 	const DocData::ClassDoc *class_doc = nullptr;
 	const ClassDB::ClassInfo *class_info = nullptr;
 	const ClassDB::ClassInfo *class_info = nullptr;
 
 
-	Dictionary to_json() {
+	Dictionary to_json() const {
 		Dictionary dict;
 		Dictionary dict;
 		dict["name"] = name;
 		dict["name"] = name;
 		dict["inherits"] = class_doc->inherits;
 		dict["inherits"] = class_doc->inherits;
@@ -1888,11 +1888,11 @@ struct GodotCapabilities {
 	 */
 	 */
 	List<GodotNativeClassInfo> native_classes;
 	List<GodotNativeClassInfo> native_classes;
 
 
-	Dictionary to_json() {
+	Dictionary to_json() const {
 		Dictionary dict;
 		Dictionary dict;
 		Array classes;
 		Array classes;
-		for (List<GodotNativeClassInfo>::Element *E = native_classes.front(); E; E = E->next()) {
-			classes.push_back(E->get().to_json());
+		for (const GodotNativeClassInfo &native_class : native_classes) {
+			classes.push_back(native_class.to_json());
 		}
 		}
 		dict["native_classes"] = classes;
 		dict["native_classes"] = classes;
 		return dict;
 		return dict;

+ 1 - 3
modules/navigation/2d/nav_mesh_generator_2d.cpp

@@ -502,9 +502,7 @@ void NavMeshGenerator2D::generator_bake_from_source_geometry_data(Ref<Navigation
 	Vector<Vector<int>> new_polygons;
 	Vector<Vector<int>> new_polygons;
 
 
 	HashMap<Vector2, int> points;
 	HashMap<Vector2, int> points;
-	for (List<TPPLPoly>::Element *I = tppl_out_polygon.front(); I; I = I->next()) {
-		TPPLPoly &tp = I->get();
-
+	for (const TPPLPoly &tp : tppl_out_polygon) {
 		Vector<int> new_polygon;
 		Vector<int> new_polygon;
 
 
 		for (int64_t i = 0; i < tp.GetNumPoints(); i++) {
 		for (int64_t i = 0; i < tp.GetNumPoints(); i++) {

+ 1 - 2
scene/animation/animation_player.cpp

@@ -256,8 +256,7 @@ void AnimationPlayer::_process_playback_data(PlaybackData &cd, double p_delta, f
 float AnimationPlayer::get_current_blend_amount() {
 float AnimationPlayer::get_current_blend_amount() {
 	Playback &c = playback;
 	Playback &c = playback;
 	float blend = 1.0;
 	float blend = 1.0;
-	for (List<Blend>::Element *E = c.blend.front(); E; E = E->next()) {
-		Blend &b = E->get();
+	for (const Blend &b : c.blend) {
 		blend = blend - b.blend_left;
 		blend = blend - b.blend_left;
 	}
 	}
 	return MAX(0, blend);
 	return MAX(0, blend);

+ 5 - 5
scene/main/node.cpp

@@ -2679,11 +2679,11 @@ bool Node::is_part_of_edited_scene() const {
 
 
 void Node::get_storable_properties(HashSet<StringName> &r_storable_properties) const {
 void Node::get_storable_properties(HashSet<StringName> &r_storable_properties) const {
 	ERR_THREAD_GUARD
 	ERR_THREAD_GUARD
-	List<PropertyInfo> pi;
-	get_property_list(&pi);
-	for (List<PropertyInfo>::Element *E = pi.front(); E; E = E->next()) {
-		if ((E->get().usage & PROPERTY_USAGE_STORAGE)) {
-			r_storable_properties.insert(E->get().name);
+	List<PropertyInfo> property_list;
+	get_property_list(&property_list);
+	for (const PropertyInfo &pi : property_list) {
+		if ((pi.usage & PROPERTY_USAGE_STORAGE)) {
+			r_storable_properties.insert(pi.name);
 		}
 		}
 	}
 	}
 }
 }

+ 1 - 3
scene/resources/2d/navigation_polygon.cpp

@@ -396,9 +396,7 @@ void NavigationPolygon::make_polygons_from_outlines() {
 	vertices.clear();
 	vertices.clear();
 
 
 	HashMap<Vector2, int> points;
 	HashMap<Vector2, int> points;
-	for (List<TPPLPoly>::Element *I = out_poly.front(); I; I = I->next()) {
-		TPPLPoly &tp = I->get();
-
+	for (const TPPLPoly &tp : out_poly) {
 		Vector<int> p;
 		Vector<int> p;
 
 
 		for (int64_t i = 0; i < tp.GetNumPoints(); i++) {
 		for (int64_t i = 0; i < tp.GetNumPoints(); i++) {

+ 3 - 4
scene/resources/3d/primitive_meshes.cpp

@@ -3105,14 +3105,13 @@ void TextMesh::_generate_glyph_mesh_data(const GlyphMeshKey &p_key, const Glyph
 		ERR_FAIL_MSG("Convex decomposing failed. Make sure the font doesn't contain self-intersecting lines, as these are not supported in TextMesh.");
 		ERR_FAIL_MSG("Convex decomposing failed. Make sure the font doesn't contain self-intersecting lines, as these are not supported in TextMesh.");
 	}
 	}
 	List<TPPLPoly> out_tris;
 	List<TPPLPoly> out_tris;
-	for (List<TPPLPoly>::Element *I = out_poly.front(); I; I = I->next()) {
-		if (tpart.Triangulate_OPT(&(I->get()), &out_tris) == 0) {
+	for (TPPLPoly &tp : out_poly) {
+		if (tpart.Triangulate_OPT(&tp, &out_tris) == 0) {
 			ERR_FAIL_MSG("Triangulation failed. Make sure the font doesn't contain self-intersecting lines, as these are not supported in TextMesh.");
 			ERR_FAIL_MSG("Triangulation failed. Make sure the font doesn't contain self-intersecting lines, as these are not supported in TextMesh.");
 		}
 		}
 	}
 	}
 
 
-	for (List<TPPLPoly>::Element *I = out_tris.front(); I; I = I->next()) {
-		TPPLPoly &tp = I->get();
+	for (const TPPLPoly &tp : out_tris) {
 		ERR_FAIL_COND(tp.GetNumPoints() != 3); // Triangles only.
 		ERR_FAIL_COND(tp.GetNumPoints() != 3); // Triangles only.
 
 
 		for (int i = 0; i < 3; i++) {
 		for (int i = 0; i < 3; i++) {

+ 18 - 18
scene/resources/material.cpp

@@ -257,10 +257,10 @@ void ShaderMaterial::_get_property_list(List<PropertyInfo> *p_list) const {
 		bool is_none_group_undefined = true;
 		bool is_none_group_undefined = true;
 		bool is_none_group = true;
 		bool is_none_group = true;
 
 
-		for (List<PropertyInfo>::Element *E = list.front(); E; E = E->next()) {
-			if (E->get().usage == PROPERTY_USAGE_GROUP) {
-				if (!E->get().name.is_empty()) {
-					Vector<String> vgroup = E->get().name.split("::");
+		for (const PropertyInfo &pi : list) {
+			if (pi.usage == PROPERTY_USAGE_GROUP) {
+				if (!pi.name.is_empty()) {
+					Vector<String> vgroup = pi.name.split("::");
 					last_group = vgroup[0];
 					last_group = vgroup[0];
 					if (vgroup.size() > 1) {
 					if (vgroup.size() > 1) {
 						last_subgroup = vgroup[1];
 						last_subgroup = vgroup[1];
@@ -322,23 +322,23 @@ void ShaderMaterial::_get_property_list(List<PropertyInfo> *p_list) const {
 				vgroups.push_back(Pair<String, LocalVector<String>>("<None>", { "<None>" }));
 				vgroups.push_back(Pair<String, LocalVector<String>>("<None>", { "<None>" }));
 			}
 			}
 
 
-			const bool is_uniform_cached = param_cache.has(E->get().name);
+			const bool is_uniform_cached = param_cache.has(pi.name);
 			bool is_uniform_type_compatible = true;
 			bool is_uniform_type_compatible = true;
 
 
 			if (is_uniform_cached) {
 			if (is_uniform_cached) {
 				// Check if the uniform Variant type changed, for example vec3 to vec4.
 				// Check if the uniform Variant type changed, for example vec3 to vec4.
-				const Variant &cached = param_cache.get(E->get().name);
+				const Variant &cached = param_cache.get(pi.name);
 
 
 				if (cached.is_array()) {
 				if (cached.is_array()) {
 					// Allow some array conversions for backwards compatibility.
 					// Allow some array conversions for backwards compatibility.
-					is_uniform_type_compatible = Variant::can_convert(E->get().type, cached.get_type());
+					is_uniform_type_compatible = Variant::can_convert(pi.type, cached.get_type());
 				} else {
 				} else {
-					is_uniform_type_compatible = E->get().type == cached.get_type();
+					is_uniform_type_compatible = pi.type == cached.get_type();
 				}
 				}
 
 
 #ifndef DISABLE_DEPRECATED
 #ifndef DISABLE_DEPRECATED
 				// PackedFloat32Array -> PackedVector4Array conversion.
 				// PackedFloat32Array -> PackedVector4Array conversion.
-				if (!is_uniform_type_compatible && E->get().type == Variant::PACKED_VECTOR4_ARRAY && cached.get_type() == Variant::PACKED_FLOAT32_ARRAY) {
+				if (!is_uniform_type_compatible && pi.type == Variant::PACKED_VECTOR4_ARRAY && cached.get_type() == Variant::PACKED_FLOAT32_ARRAY) {
 					PackedVector4Array varray;
 					PackedVector4Array varray;
 					PackedFloat32Array array = (PackedFloat32Array)cached;
 					PackedFloat32Array array = (PackedFloat32Array)cached;
 
 
@@ -346,28 +346,28 @@ void ShaderMaterial::_get_property_list(List<PropertyInfo> *p_list) const {
 						varray.push_back(Vector4(array[i], array[i + 1], array[i + 2], array[i + 3]));
 						varray.push_back(Vector4(array[i], array[i + 1], array[i + 2], array[i + 3]));
 					}
 					}
 
 
-					param_cache.insert(E->get().name, varray);
+					param_cache.insert(pi.name, varray);
 					is_uniform_type_compatible = true;
 					is_uniform_type_compatible = true;
 				}
 				}
 #endif
 #endif
 
 
-				if (is_uniform_type_compatible && E->get().type == Variant::OBJECT && cached.get_type() == Variant::OBJECT) {
+				if (is_uniform_type_compatible && pi.type == Variant::OBJECT && cached.get_type() == Variant::OBJECT) {
 					// Check if the Object class (hint string) changed, for example Texture2D sampler to Texture3D.
 					// Check if the Object class (hint string) changed, for example Texture2D sampler to Texture3D.
 					// Allow inheritance, Texture2D type sampler should also accept CompressedTexture2D.
 					// Allow inheritance, Texture2D type sampler should also accept CompressedTexture2D.
 					Object *cached_obj = cached;
 					Object *cached_obj = cached;
-					if (!cached_obj->is_class(E->get().hint_string)) {
+					if (!cached_obj->is_class(pi.hint_string)) {
 						is_uniform_type_compatible = false;
 						is_uniform_type_compatible = false;
 					}
 					}
 				}
 				}
 			}
 			}
 
 
-			PropertyInfo info = E->get();
+			PropertyInfo info = pi;
 			info.name = "shader_parameter/" + info.name;
 			info.name = "shader_parameter/" + info.name;
 			if (!is_uniform_cached || !is_uniform_type_compatible) {
 			if (!is_uniform_cached || !is_uniform_type_compatible) {
 				// Property has never been edited or its type changed, retrieve with default value.
 				// Property has never been edited or its type changed, retrieve with default value.
-				Variant default_value = RenderingServer::get_singleton()->shader_get_parameter_default(shader->get_rid(), E->get().name);
-				param_cache.insert(E->get().name, default_value);
-				remap_cache.insert(info.name, E->get().name);
+				Variant default_value = RenderingServer::get_singleton()->shader_get_parameter_default(shader->get_rid(), pi.name);
+				param_cache.insert(pi.name, default_value);
+				remap_cache.insert(info.name, pi.name);
 			}
 			}
 			groups[last_group][last_subgroup].push_back(info);
 			groups[last_group][last_subgroup].push_back(info);
 		}
 		}
@@ -376,8 +376,8 @@ void ShaderMaterial::_get_property_list(List<PropertyInfo> *p_list) const {
 			String group = group_pair.first;
 			String group = group_pair.first;
 			for (const String &subgroup : group_pair.second) {
 			for (const String &subgroup : group_pair.second) {
 				List<PropertyInfo> &prop_infos = groups[group][subgroup];
 				List<PropertyInfo> &prop_infos = groups[group][subgroup];
-				for (List<PropertyInfo>::Element *item = prop_infos.front(); item; item = item->next()) {
-					p_list->push_back(item->get());
+				for (const PropertyInfo &item : prop_infos) {
+					p_list->push_back(item);
 				}
 				}
 			}
 			}
 		}
 		}

+ 9 - 9
scene/resources/resource_format_text.cpp

@@ -1905,18 +1905,18 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const Ref<Reso
 
 
 		List<PropertyInfo> property_list;
 		List<PropertyInfo> property_list;
 		res->get_property_list(&property_list);
 		res->get_property_list(&property_list);
-		for (List<PropertyInfo>::Element *PE = property_list.front(); PE; PE = PE->next()) {
-			if (skip_editor && PE->get().name.begins_with("__editor")) {
+		for (const PropertyInfo &pi : property_list) {
+			if (skip_editor && pi.name.begins_with("__editor")) {
 				continue;
 				continue;
 			}
 			}
-			if (PE->get().name == META_PROPERTY_MISSING_RESOURCES) {
+			if (pi.name == META_PROPERTY_MISSING_RESOURCES) {
 				continue;
 				continue;
 			}
 			}
 
 
-			if (PE->get().usage & PROPERTY_USAGE_STORAGE || missing_resource_properties.has(PE->get().name)) {
-				String name = PE->get().name;
+			if (pi.usage & PROPERTY_USAGE_STORAGE || missing_resource_properties.has(pi.name)) {
+				String name = pi.name;
 				Variant value;
 				Variant value;
-				if (PE->get().usage & PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT) {
+				if (pi.usage & PROPERTY_USAGE_RESOURCE_NOT_PERSISTENT) {
 					NonPersistentKey npk;
 					NonPersistentKey npk;
 					npk.base = res;
 					npk.base = res;
 					npk.property = name;
 					npk.property = name;
@@ -1927,11 +1927,11 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const Ref<Reso
 					value = res->get(name);
 					value = res->get(name);
 				}
 				}
 
 
-				if (PE->get().type == Variant::OBJECT && missing_resource_properties.has(PE->get().name)) {
+				if (pi.type == Variant::OBJECT && missing_resource_properties.has(pi.name)) {
 					// Was this missing resource overridden? If so do not save the old value.
 					// Was this missing resource overridden? If so do not save the old value.
 					Ref<Resource> ures = value;
 					Ref<Resource> ures = value;
 					if (ures.is_null()) {
 					if (ures.is_null()) {
-						value = missing_resource_properties[PE->get().name];
+						value = missing_resource_properties[pi.name];
 					}
 					}
 				}
 				}
 
 
@@ -1941,7 +1941,7 @@ Error ResourceFormatSaverTextInstance::save(const String &p_path, const Ref<Reso
 					continue;
 					continue;
 				}
 				}
 
 
-				if (PE->get().type == Variant::OBJECT && value.is_zero() && !(PE->get().usage & PROPERTY_USAGE_STORE_IF_NULL)) {
+				if (pi.type == Variant::OBJECT && value.is_zero() && !(pi.usage & PROPERTY_USAGE_STORE_IF_NULL)) {
 					continue;
 					continue;
 				}
 				}
 
 

+ 2 - 2
servers/rendering/renderer_rd/storage_rd/texture_storage.cpp

@@ -1645,8 +1645,8 @@ void TextureStorage::texture_debug_usage(List<RS::TextureInfo> *r_info) {
 	List<RID> textures;
 	List<RID> textures;
 	texture_owner.get_owned_list(&textures);
 	texture_owner.get_owned_list(&textures);
 
 
-	for (List<RID>::Element *E = textures.front(); E; E = E->next()) {
-		Texture *t = texture_owner.get_or_null(E->get());
+	for (const RID &rid : textures) {
+		Texture *t = texture_owner.get_or_null(rid);
 		if (!t) {
 		if (!t) {
 			continue;
 			continue;
 		}
 		}