diff options
author | Aaron Record <aaronjrecord@gmail.com> | 2022-05-18 17:43:40 -0600 |
---|---|---|
committer | Aaron Record <aaronjrecord@gmail.com> | 2022-05-19 12:09:16 +0200 |
commit | 900c676b0282bed83d00834e3c280ac89c2bc94d (patch) | |
tree | b6bf869a55440a666f4bcc17d5e9cd93ff26dbdc /modules/gdscript | |
parent | 71c40ff4da85a4770958533cdc65f2c9f7ddeaff (diff) |
Use range iterators for RBSet in most cases
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gdscript.cpp | 12 | ||||
-rw-r--r-- | modules/gdscript/language_server/gdscript_workspace.cpp | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/modules/gdscript/gdscript.cpp b/modules/gdscript/gdscript.cpp index e400d0bf94..25f4823d92 100644 --- a/modules/gdscript/gdscript.cpp +++ b/modules/gdscript/gdscript.cpp @@ -764,8 +764,8 @@ bool GDScript::_update_exports(bool *r_err, bool p_recursive_call, PlaceHolderSc _update_exports_values(values, propnames); if (changed) { - for (RBSet<PlaceHolderScriptInstance *>::Element *E = placeholders.front(); E; E = E->next()) { - E->get()->update(propnames, values); + for (PlaceHolderScriptInstance *E : placeholders) { + E->update(propnames, values); } } else { p_instance_to_update->update(propnames, values); @@ -790,8 +790,8 @@ void GDScript::update_exports() { RBSet<ObjectID> copy = inheriters_cache; //might get modified - for (RBSet<ObjectID>::Element *E = copy.front(); E; E = E->next()) { - Object *id = ObjectDB::get_instance(E->get()); + for (const ObjectID &E : copy) { + Object *id = ObjectDB::get_instance(E); GDScript *s = Object::cast_to<GDScript>(id); if (!s) { continue; @@ -939,8 +939,8 @@ void GDScript::get_constants(HashMap<StringName, Variant> *p_constants) { void GDScript::get_members(RBSet<StringName> *p_members) { if (p_members) { - for (RBSet<StringName>::Element *E = members.front(); E; E = E->next()) { - p_members->insert(E->get()); + for (const StringName &E : members) { + p_members->insert(E); } } } diff --git a/modules/gdscript/language_server/gdscript_workspace.cpp b/modules/gdscript/language_server/gdscript_workspace.cpp index d9de112bb0..ffd3cfa907 100644 --- a/modules/gdscript/language_server/gdscript_workspace.cpp +++ b/modules/gdscript/language_server/gdscript_workspace.cpp @@ -794,7 +794,7 @@ GDScriptWorkspace::~GDScriptWorkspace() { cached_parsers.insert(E.key); } - for (RBSet<String>::Element *E = cached_parsers.front(); E; E = E->next()) { - remove_cache_parser(E->get()); + for (const String &E : cached_parsers) { + remove_cache_parser(E); } } |