You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-04 17:04:49 +00:00
Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
This commit is contained in:
@@ -46,13 +46,15 @@ Error UDPServer::listen(uint16_t p_port, const IP_Address &p_bind_address) {
|
||||
Error err;
|
||||
IP::Type ip_type = IP::TYPE_ANY;
|
||||
|
||||
if (p_bind_address.is_valid())
|
||||
if (p_bind_address.is_valid()) {
|
||||
ip_type = p_bind_address.is_ipv4() ? IP::TYPE_IPV4 : IP::TYPE_IPV6;
|
||||
}
|
||||
|
||||
err = _sock->open(NetSocket::TYPE_UDP, ip_type);
|
||||
|
||||
if (err != OK)
|
||||
if (err != OK) {
|
||||
return ERR_CANT_CREATE;
|
||||
}
|
||||
|
||||
_sock->set_blocking_enabled(false);
|
||||
_sock->set_reuse_address_enabled(true);
|
||||
@@ -76,8 +78,9 @@ bool UDPServer::is_listening() const {
|
||||
bool UDPServer::is_connection_available() const {
|
||||
ERR_FAIL_COND_V(!_sock.is_valid(), false);
|
||||
|
||||
if (!_sock->is_open())
|
||||
if (!_sock->is_open()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Error err = _sock->poll(NetSocket::POLL_TYPE_IN, 0);
|
||||
return (err == OK);
|
||||
|
||||
Reference in New Issue
Block a user