summaryrefslogtreecommitdiffstats
path: root/modules/websocket
diff options
context:
space:
mode:
authorA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-01-19 13:21:39 +0100
committerA Thousand Ships <96648715+AThousandShips@users.noreply.github.com>2024-02-09 12:50:15 +0100
commit684752e75bdeb58727c2d9b0ff0265d7fcd47de0 (patch)
tree4fc57e9d0738021b8b31699a6339275347e38ec0 /modules/websocket
parent94dbf69f5d6b7d2fd9561692df2e71557607fddc (diff)
downloadredot-engine-684752e75bdeb58727c2d9b0ff0265d7fcd47de0.tar.gz
Replace error checks against `size` with `is_empty`
Diffstat (limited to 'modules/websocket')
-rw-r--r--modules/websocket/remote_debugger_peer_websocket.cpp2
-rw-r--r--modules/websocket/websocket_multiplayer_peer.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/modules/websocket/remote_debugger_peer_websocket.cpp b/modules/websocket/remote_debugger_peer_websocket.cpp
index 791b6d9ec9..dc6833e8c3 100644
--- a/modules/websocket/remote_debugger_peer_websocket.cpp
+++ b/modules/websocket/remote_debugger_peer_websocket.cpp
@@ -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;
diff --git a/modules/websocket/websocket_multiplayer_peer.cpp b/modules/websocket/websocket_multiplayer_peer.cpp
index 9e706dbeef..332cf93d36 100644
--- a/modules/websocket/websocket_multiplayer_peer.cpp
+++ b/modules/websocket/websocket_multiplayer_peer.cpp
@@ -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;
}