Replace error checks against size with is_empty
This commit is contained in:
@ -91,7 +91,7 @@ bool RemoteDebuggerPeerWebSocket::has_message() {
|
||||
}
|
||||
|
||||
Array RemoteDebuggerPeerWebSocket::get_message() {
|
||||
ERR_FAIL_COND_V(in_queue.size() < 1, Array());
|
||||
ERR_FAIL_COND_V(in_queue.is_empty(), Array());
|
||||
Array msg = in_queue[0];
|
||||
in_queue.pop_front();
|
||||
return msg;
|
||||
|
||||
@ -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