mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
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:
parent
31ded7e126
commit
49403cbfa0
226 changed files with 1051 additions and 1034 deletions
|
@ -83,11 +83,11 @@ bool WSLServer::PendingPeer::_parse_request(const Vector<String> p_protocols, St
|
|||
break;
|
||||
}
|
||||
// Found a protocol
|
||||
if (protocol != "") {
|
||||
if (!protocol.is_empty()) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (protocol == "") { // Invalid protocol(s) requested
|
||||
if (protocol.is_empty()) { // Invalid protocol(s) requested
|
||||
return false;
|
||||
}
|
||||
} else if (p_protocols.size() > 0) { // No protocol requested, but we need one
|
||||
|
@ -138,7 +138,7 @@ Error WSLServer::PendingPeer::do_handshake(const Vector<String> p_protocols, uin
|
|||
s += "Upgrade: websocket\r\n";
|
||||
s += "Connection: Upgrade\r\n";
|
||||
s += "Sec-WebSocket-Accept: " + WSLPeer::compute_key_response(key) + "\r\n";
|
||||
if (protocol != "") {
|
||||
if (!protocol.is_empty()) {
|
||||
s += "Sec-WebSocket-Protocol: " + protocol + "\r\n";
|
||||
}
|
||||
s += "\r\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue