fix ignore-host filter

This commit is contained in:
yggverse 2025-06-08 19:10:36 +03:00
parent 4cb9e816fd
commit 976c11410f

View file

@ -37,19 +37,22 @@ fn main() -> anyhow::Result<()> {
let mut index: HashMap<String, usize> = HashMap::with_capacity(argument.capacity);
for line in reader.lines() {
'l: for line in reader.lines() {
let host = line?
.split_whitespace()
.next()
.map(|s| s.into())
.unwrap_or_default();
if argument.ignore_host.contains(&host) {
for h in &argument.ignore_host {
if h == &host {
if is_debug_d {
debug::info(format!("Host `{host}` ignored by settings"))
debug::info(format!("Host `{h}` ignored by settings"))
}
continue;
continue 'l;
}
}
index.entry(host).and_modify(|c| *c += 1).or_insert(1);
}