core/src/connections: Avoid call to contains twice (#2279)

This commit is contained in:
r-zig
2021-10-08 11:18:34 +03:00
committed by GitHub
parent 5ef430b8d8
commit 57f34f6f26

View File

@ -264,8 +264,7 @@ where
Poll::Ready(Some(Ok(ListenerEvent::NewAddress(a)))) => {
if listener_project.addresses.contains(&a) {
debug!("Transport has reported address {} multiple times", a)
}
if !listener_project.addresses.contains(&a) {
} else {
listener_project.addresses.push(a.clone());
}
let id = *listener_project.id;