1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-06 12:20:30 +00:00

Use C++ iterators for Lists in many situations

This commit is contained in:
Aaron Franke
2021-07-15 23:45:57 -04:00
parent b918c4c3ce
commit 4e6efd1b07
218 changed files with 2755 additions and 3004 deletions

View File

@@ -220,8 +220,8 @@ bool HTTPRequest::_handle_response(bool *ret_value) {
client->get_response_headers(&rheaders);
response_headers.resize(0);
downloaded.set(0);
for (List<String>::Element *E = rheaders.front(); E; E = E->next()) {
response_headers.push_back(E->get());
for (String &E : rheaders) {
response_headers.push_back(E);
}
if (response_code == 301 || response_code == 302) {
@@ -235,9 +235,9 @@ bool HTTPRequest::_handle_response(bool *ret_value) {
String new_request;
for (List<String>::Element *E = rheaders.front(); E; E = E->next()) {
if (E->get().findn("Location: ") != -1) {
new_request = E->get().substr(9, E->get().length()).strip_edges();
for (String &E : rheaders) {
if (E.findn("Location: ") != -1) {
new_request = E.substr(9, E.length()).strip_edges();
}
}