You've already forked godot
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user