Replace String comparisons with "", String() to is_empty()

Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
This commit is contained in:
Nathan Franke 2021-12-09 03:42:46 -06:00
parent 31ded7e126
commit 49403cbfa0
No known key found for this signature in database
GPG key ID: 92164DCCF3B1F723
226 changed files with 1051 additions and 1034 deletions

View file

@ -243,7 +243,7 @@ bool HTTPRequest::_handle_response(bool *ret_value) {
}
}
if (new_request != "") {
if (!new_request.is_empty()) {
// Process redirect
client->close();
int new_redirs = redirections + 1; // Because _request() will clear it
@ -363,7 +363,7 @@ bool HTTPRequest::_update_connection() {
return true;
}
if (download_to_file != String()) {
if (!download_to_file.is_empty()) {
file = FileAccess::open(download_to_file, FileAccess::WRITE);
if (!file) {
call_deferred(SNAME("_request_done"), RESULT_DOWNLOAD_FILE_CANT_OPEN, response_code, response_headers, PackedByteArray());