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

@@ -221,7 +221,7 @@ void WorkerThreadPool::_post_tasks(Task **p_tasks, uint32_t p_count, bool p_high
// Fall back to processing on the calling thread if there are no worker threads.
// Separated into its own variable to make it easier to extend this logic
// in custom builds.
bool process_on_calling_thread = threads.size() == 0;
bool process_on_calling_thread = threads.is_empty();
if (process_on_calling_thread) {
p_lock.temp_unlock();
for (uint32_t i = 0; i < p_count; i++) {
@@ -789,7 +789,7 @@ void WorkerThreadPool::init(int p_thread_count, float p_low_priority_task_ratio)
}
void WorkerThreadPool::exit_languages_threads() {
if (threads.size() == 0) {
if (threads.is_empty()) {
return;
}
@@ -809,7 +809,7 @@ void WorkerThreadPool::exit_languages_threads() {
}
void WorkerThreadPool::finish() {
if (threads.size() == 0) {
if (threads.is_empty()) {
return;
}