Replace error checks against size with is_empty
This commit is contained in:
parent
94dbf69f5d
commit
684752e75b
58 changed files with 116 additions and 116 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue