Using iterator pattern instead of List::Element *.
Co-authored-by: Adam Scott <ascott.ca@gmail.com>
This commit is contained in:
parent
594d64ec24
commit
22b5ec17fb
36 changed files with 150 additions and 173 deletions
|
|
@ -72,8 +72,8 @@ Error ENetConnection::create_host(int p_max_peers, int p_max_channels, int p_in_
|
|||
|
||||
void ENetConnection::destroy() {
|
||||
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();
|
||||
enet_host_destroy(host);
|
||||
|
|
|
|||
|
|
@ -1508,8 +1508,8 @@ static void _find_identifiers(const GDScriptParser::CompletionContext &p_context
|
|||
List<StringName> 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.display += U"(\u2026)"; // As all utility functions contain an argument or more, this is hardcoded here.
|
||||
r_result.insert(option.display, option);
|
||||
|
|
|
|||
|
|
@ -543,8 +543,8 @@ Vector<LSP::Location> GDScriptWorkspace::find_all_usages(const LSP::DocumentSymb
|
|||
list_script_files("res://", paths);
|
||||
|
||||
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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1873,7 +1873,7 @@ struct GodotNativeClassInfo {
|
|||
const DocData::ClassDoc *class_doc = nullptr;
|
||||
const ClassDB::ClassInfo *class_info = nullptr;
|
||||
|
||||
Dictionary to_json() {
|
||||
Dictionary to_json() const {
|
||||
Dictionary dict;
|
||||
dict["name"] = name;
|
||||
dict["inherits"] = class_doc->inherits;
|
||||
|
|
@ -1888,11 +1888,11 @@ struct GodotCapabilities {
|
|||
*/
|
||||
List<GodotNativeClassInfo> native_classes;
|
||||
|
||||
Dictionary to_json() {
|
||||
Dictionary to_json() const {
|
||||
Dictionary dict;
|
||||
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;
|
||||
return dict;
|
||||
|
|
|
|||
|
|
@ -502,9 +502,7 @@ void NavMeshGenerator2D::generator_bake_from_source_geometry_data(Ref<Navigation
|
|||
Vector<Vector<int>> new_polygons;
|
||||
|
||||
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;
|
||||
|
||||
for (int64_t i = 0; i < tp.GetNumPoints(); i++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue