diff options
author | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-01-19 13:21:39 +0100 |
---|---|---|
committer | A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> | 2024-02-09 12:50:15 +0100 |
commit | 684752e75bdeb58727c2d9b0ff0265d7fcd47de0 (patch) | |
tree | 4fc57e9d0738021b8b31699a6339275347e38ec0 /modules/multiplayer/multiplayer_debugger.cpp | |
parent | 94dbf69f5d6b7d2fd9561692df2e71557607fddc (diff) | |
download | redot-engine-684752e75bdeb58727c2d9b0ff0265d7fcd47de0.tar.gz |
Replace error checks against `size` with `is_empty`
Diffstat (limited to 'modules/multiplayer/multiplayer_debugger.cpp')
-rw-r--r-- | modules/multiplayer/multiplayer_debugger.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/multiplayer/multiplayer_debugger.cpp b/modules/multiplayer/multiplayer_debugger.cpp index a4d2aed2d6..c816bd3b6b 100644 --- a/modules/multiplayer/multiplayer_debugger.cpp +++ b/modules/multiplayer/multiplayer_debugger.cpp @@ -89,7 +89,7 @@ Error MultiplayerDebugger::_capture(void *p_user, const String &p_msg, const Arr // BandwidthProfiler int MultiplayerDebugger::BandwidthProfiler::bandwidth_usage(const Vector<BandwidthFrame> &p_buffer, int p_pointer) { - ERR_FAIL_COND_V(p_buffer.size() == 0, 0); + ERR_FAIL_COND_V(p_buffer.is_empty(), 0); int total_bandwidth = 0; uint64_t timestamp = OS::get_singleton()->get_ticks_msec(); @@ -174,7 +174,7 @@ Array MultiplayerDebugger::RPCFrame::serialize() { } bool MultiplayerDebugger::RPCFrame::deserialize(const Array &p_arr) { - ERR_FAIL_COND_V(p_arr.size() < 1, false); + ERR_FAIL_COND_V(p_arr.is_empty(), false); uint32_t size = p_arr[0]; ERR_FAIL_COND_V(size % 6, false); ERR_FAIL_COND_V((uint32_t)p_arr.size() != size + 1, false); @@ -279,7 +279,7 @@ Array MultiplayerDebugger::ReplicationFrame::serialize() { } bool MultiplayerDebugger::ReplicationFrame::deserialize(const Array &p_arr) { - ERR_FAIL_COND_V(p_arr.size() < 1, false); + ERR_FAIL_COND_V(p_arr.is_empty(), false); uint32_t size = p_arr[0]; ERR_FAIL_COND_V(size % 7, false); ERR_FAIL_COND_V((uint32_t)p_arr.size() != size + 1, false); |