mirror of
https://codeberg.org/YGGverse/psocks.git
synced 2026-04-01 00:45:27 +00:00
minor logic optimization
This commit is contained in:
parent
239a85ca47
commit
82b09d74ae
3 changed files with 13 additions and 13 deletions
11
src/list.rs
11
src/list.rs
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue