You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
This commit is contained in:
committed by
AThousandShips
parent
0f95e9f8e6
commit
a1846b27ea
@@ -111,7 +111,7 @@ Error PacketPeerMbedDTLS::_do_handshake() {
|
||||
}
|
||||
|
||||
Error PacketPeerMbedDTLS::connect_to_peer(Ref<PacketPeerUDP> p_base, const String &p_hostname, Ref<TLSOptions> p_options) {
|
||||
ERR_FAIL_COND_V(!p_base.is_valid() || !p_base->is_socket_connected(), ERR_INVALID_PARAMETER);
|
||||
ERR_FAIL_COND_V(p_base.is_null() || !p_base->is_socket_connected(), ERR_INVALID_PARAMETER);
|
||||
|
||||
Error err = tls_ctx->init_client(MBEDTLS_SSL_TRANSPORT_DATAGRAM, p_hostname, p_options.is_valid() ? p_options : TLSOptions::client());
|
||||
ERR_FAIL_COND_V(err != OK, err);
|
||||
@@ -132,7 +132,7 @@ Error PacketPeerMbedDTLS::connect_to_peer(Ref<PacketPeerUDP> p_base, const Strin
|
||||
}
|
||||
|
||||
Error PacketPeerMbedDTLS::accept_peer(Ref<PacketPeerUDP> p_base, Ref<TLSOptions> p_options, Ref<CookieContextMbedTLS> p_cookies) {
|
||||
ERR_FAIL_COND_V(!p_base.is_valid() || !p_base->is_socket_connected(), ERR_INVALID_PARAMETER);
|
||||
ERR_FAIL_COND_V(p_base.is_null() || !p_base->is_socket_connected(), ERR_INVALID_PARAMETER);
|
||||
|
||||
Error err = tls_ctx->init_server(MBEDTLS_SSL_TRANSPORT_DATAGRAM, p_options, p_cookies);
|
||||
ERR_FAIL_COND_V(err != OK, err);
|
||||
@@ -213,7 +213,7 @@ void PacketPeerMbedDTLS::poll() {
|
||||
return;
|
||||
}
|
||||
|
||||
ERR_FAIL_COND(!base.is_valid());
|
||||
ERR_FAIL_COND(base.is_null());
|
||||
|
||||
int ret = mbedtls_ssl_read(tls_ctx->get_context(), nullptr, 0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user