minor logic optimization

This commit is contained in:
postscriptum 2026-03-23 04:28:36 +02:00
parent 239a85ca47
commit 82b09d74ae
3 changed files with 13 additions and 13 deletions

View file

@ -51,13 +51,10 @@ impl List {
cache,
})
}
pub async fn any(&self, values: &[&str]) -> bool {
let guard = self.index.read().await;
values.iter().any(|&value| {
guard.iter().any(|item| match item {
Item::Exact(v) => v == value,
Item::Ending(v) => value.ends_with(v),
})
pub async fn any(&self, value: &str) -> bool {
self.index.read().await.iter().any(|item| match item {
Item::Exact(v) => v == value,
Item::Ending(v) => value.ends_with(v),
})
}
pub async fn entries(&self) -> u64 {