From e3fc7112bc3b449ffdcc5d3d62a4ef2ea07fc43e Mon Sep 17 00:00:00 2001 From: Cong Chen Date: Thu, 29 Jun 2023 11:46:47 +0800 Subject: [PATCH] use `RoaringBitmap::is_empty` instead --- index-scheduler/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index-scheduler/src/lib.rs b/index-scheduler/src/lib.rs index c1b2deb27..fc017395e 100644 --- a/index-scheduler/src/lib.rs +++ b/index-scheduler/src/lib.rs @@ -796,8 +796,7 @@ impl IndexScheduler { // Return true if there is at least one task that is processing. pub fn is_task_processing(&self) -> Result { - let processing_tasks = self.processing_tasks.read().unwrap().processing.len(); - Ok(processing_tasks > 0) + Ok(self.processing_tasks.read().unwrap().processing.is_empty()) } /// Return true iff there is at least one task associated with this index