Replace size() == 0 with is_empty().

This commit is contained in:
Yufeng Ying 2025-03-20 00:07:31 +08:00
parent c7ea8614d7
commit 4f4031a675
147 changed files with 300 additions and 300 deletions

View file

@ -242,7 +242,7 @@ void LocalDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) {
} else if (line.begins_with("br") || line.begins_with("break")) {
if (line.get_slice_count(" ") <= 1) {
const HashMap<int, HashSet<StringName>> &breakpoints = script_debugger->get_breakpoints();
if (breakpoints.size() == 0) {
if (breakpoints.is_empty()) {
print_line("No Breakpoints.");
continue;
}

View file

@ -96,7 +96,7 @@ void RemoteDebuggerPeerTCP::_write_out() {
while (tcp_client->get_status() == StreamPeerTCP::STATUS_CONNECTED && tcp_client->wait(NetSocket::POLL_TYPE_OUT) == OK) {
uint8_t *buf = out_buf.ptrw();
if (out_left <= 0) {
if (out_queue.size() == 0) {
if (out_queue.is_empty()) {
break; // Nothing left to send
}
mutex.lock();

View file

@ -58,7 +58,7 @@ void ScriptDebugger::remove_breakpoint(int p_line, const StringName &p_source) {
}
breakpoints[p_line].erase(p_source);
if (breakpoints[p_line].size() == 0) {
if (breakpoints[p_line].is_empty()) {
breakpoints.erase(p_line);
}
}