You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user