diff --git a/rocketmq-common/src/common/stats/stats_item.rs b/rocketmq-common/src/common/stats/stats_item.rs index 202e2167..86b0185e 100644 --- a/rocketmq-common/src/common/stats/stats_item.rs +++ b/rocketmq-common/src/common/stats/stats_item.rs @@ -56,7 +56,7 @@ impl StatsItem { pub fn compute_stats_data(cs_list: Arc>>) -> StatsSnapshot { let mut stats_snapshot = StatsSnapshot::new(); let cs_list = cs_list.lock(); - if cs_list.len() > 0 { + if !cs_list.is_empty() { let first = cs_list.front().unwrap(); let last = cs_list.back().unwrap(); let sum = last.get_value() - first.get_value();