1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Replace error checks against size with is_empty

This commit is contained in:
A Thousand Ships
2024-01-19 13:21:39 +01:00
parent 94dbf69f5d
commit 684752e75b
58 changed files with 116 additions and 116 deletions

View File

@@ -124,7 +124,7 @@ Error WebSocketMultiplayerPeer::get_packet(const uint8_t **r_buffer, int &r_buff
current_packet.data = nullptr;
}
ERR_FAIL_COND_V(incoming_packets.size() == 0, ERR_UNAVAILABLE);
ERR_FAIL_COND_V(incoming_packets.is_empty(), ERR_UNAVAILABLE);
current_packet = incoming_packets.front()->get();
incoming_packets.pop_front();
@@ -164,7 +164,7 @@ void WebSocketMultiplayerPeer::set_target_peer(int p_target_peer) {
}
int WebSocketMultiplayerPeer::get_packet_peer() const {
ERR_FAIL_COND_V(incoming_packets.size() == 0, 1);
ERR_FAIL_COND_V(incoming_packets.is_empty(), 1);
return incoming_packets.front()->get().source;
}