diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-07-25 12:52:58 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-25 12:52:58 +0200 |
commit | ff0b5f8fa1be4ccd5b8de1d9d49f8a4b71439f63 (patch) | |
tree | 42543cc85d27d2c8692a2ced4bac5c537e402004 /scene/main | |
parent | 2f221e5fd507b176590bda52d08e499629ce7761 (diff) | |
parent | ac3322b0af8f23e8e2dac8111200bc69b5604c9f (diff) |
Merge pull request #50809 from akien-mga/iterators-const-references
Diffstat (limited to 'scene/main')
-rw-r--r-- | scene/main/http_request.cpp | 4 | ||||
-rw-r--r-- | scene/main/instance_placeholder.cpp | 4 | ||||
-rw-r--r-- | scene/main/node.cpp | 16 | ||||
-rw-r--r-- | scene/main/scene_tree.cpp | 4 | ||||
-rw-r--r-- | scene/main/window.cpp | 2 |
5 files changed, 15 insertions, 15 deletions
diff --git a/scene/main/http_request.cpp b/scene/main/http_request.cpp index 588d4b67d5..2c6cefa771 100644 --- a/scene/main/http_request.cpp +++ b/scene/main/http_request.cpp @@ -220,7 +220,7 @@ bool HTTPRequest::_handle_response(bool *ret_value) { client->get_response_headers(&rheaders); response_headers.resize(0); downloaded.set(0); - for (String &E : rheaders) { + for (const String &E : rheaders) { response_headers.push_back(E); } @@ -235,7 +235,7 @@ bool HTTPRequest::_handle_response(bool *ret_value) { String new_request; - for (String &E : rheaders) { + for (const String &E : rheaders) { if (E.findn("Location: ") != -1) { new_request = E.substr(9, E.length()).strip_edges(); } diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp index b7c6723cfc..b5ba1899ec 100644 --- a/scene/main/instance_placeholder.cpp +++ b/scene/main/instance_placeholder.cpp @@ -95,7 +95,7 @@ Node *InstancePlaceholder::create_instance(bool p_replace, const Ref<PackedScene scene->set_name(get_name()); int pos = get_index(); - for (PropSet &E : stored_values) { + for (const PropSet &E : stored_values) { scene->set(E.name, E.value); } @@ -114,7 +114,7 @@ Dictionary InstancePlaceholder::get_stored_values(bool p_with_order) { Dictionary ret; PackedStringArray order; - for (PropSet &E : stored_values) { + for (const PropSet &E : stored_values) { ret[E.name] = E.value; if (p_with_order) { order.push_back(E.name); diff --git a/scene/main/node.cpp b/scene/main/node.cpp index 4b496d4761..f1e5574351 100644 --- a/scene/main/node.cpp +++ b/scene/main/node.cpp @@ -1597,7 +1597,7 @@ Array Node::_get_groups() const { Array groups; List<GroupInfo> gi; get_groups(&gi); - for (GroupInfo &E : gi) { + for (const GroupInfo &E : gi) { groups.push_back(E.name); } @@ -1947,7 +1947,7 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const List<PropertyInfo> plist; N->get()->get_property_list(&plist); - for (PropertyInfo &E : plist) { + for (const PropertyInfo &E : plist) { if (!(E.usage & PROPERTY_USAGE_STORAGE)) { continue; } @@ -1983,7 +1983,7 @@ Node *Node::_duplicate(int p_flags, Map<const Node *, Node *> *r_duplimap) const if (p_flags & DUPLICATE_GROUPS) { List<GroupInfo> gi; get_groups(&gi); - for (GroupInfo &E : gi) { + for (const GroupInfo &E : gi) { #ifdef TOOLS_ENABLED if ((p_flags & DUPLICATE_FROM_EDITOR) && !E.persistent) { continue; @@ -2073,7 +2073,7 @@ void Node::remap_node_resources(Node *p_node, const Map<RES, RES> &p_resource_re List<PropertyInfo> props; p_node->get_property_list(&props); - for (PropertyInfo &E : props) { + for (const PropertyInfo &E : props) { if (!(E.usage & PROPERTY_USAGE_STORAGE)) { continue; } @@ -2099,7 +2099,7 @@ void Node::remap_nested_resources(RES p_resource, const Map<RES, RES> &p_resourc List<PropertyInfo> props; p_resource->get_property_list(&props); - for (PropertyInfo &E : props) { + for (const PropertyInfo &E : props) { if (!(E.usage & PROPERTY_USAGE_STORAGE)) { continue; } @@ -2135,7 +2135,7 @@ void Node::_duplicate_signals(const Node *p_original, Node *p_copy) const { List<Connection> conns; n->get_all_signal_connections(&conns); - for (Connection &E : conns) { + for (const Connection &E : conns) { if (E.flags & CONNECT_PERSIST) { //user connected NodePath p = p_original->get_path_to(n); @@ -2194,7 +2194,7 @@ void Node::replace_by(Node *p_node, bool p_keep_groups) { List<GroupInfo> groups; get_groups(&groups); - for (GroupInfo &E : groups) { + for (const GroupInfo &E : groups) { p_node->add_to_group(E.name, E.persistent); } } @@ -2241,7 +2241,7 @@ void Node::_replace_connections_target(Node *p_new_target) { List<Connection> cl; get_signals_connected_to_this(&cl); - for (Connection &c : cl) { + for (const Connection &c : cl) { if (c.flags & CONNECT_PERSIST) { c.signal.get_object()->disconnect(c.signal.get_name(), Callable(this, c.callable.get_method())); bool valid = p_new_target->has_method(c.callable.get_method()) || Ref<Script>(p_new_target->get_script()).is_null() || Ref<Script>(p_new_target->get_script())->has_method(c.callable.get_method()); diff --git a/scene/main/scene_tree.cpp b/scene/main/scene_tree.cpp index 8bca76a794..adba7f1a31 100644 --- a/scene/main/scene_tree.cpp +++ b/scene/main/scene_tree.cpp @@ -94,7 +94,7 @@ void SceneTreeTimer::release_connections() { List<Connection> connections; get_all_signal_connections(&connections); - for (Connection &connection : connections) { + for (const Connection &connection : connections) { disconnect(connection.signal.get_name(), connection.callable); } } @@ -1402,7 +1402,7 @@ SceneTree::SceneTree() { List<String> exts; ResourceLoader::get_recognized_extensions_for_type("Environment", &exts); String ext_hint; - for (String &E : exts) { + for (const String &E : exts) { if (ext_hint != String()) { ext_hint += ","; } diff --git a/scene/main/window.cpp b/scene/main/window.cpp index 4ebfe301ab..ab1846660b 100644 --- a/scene/main/window.cpp +++ b/scene/main/window.cpp @@ -1356,7 +1356,7 @@ void Window::_validate_property(PropertyInfo &property) const { Vector<StringName> unique_names; String hint_string; - for (StringName &E : names) { + for (const StringName &E : names) { // Skip duplicate values. if (unique_names.has(E)) { continue; |