code clean-up: @discardableResult, unused params, simplify getting specific relays from pool

Closes: #635
This commit is contained in:
Bryan Montz
2023-02-17 06:58:53 -06:00
committed by William Casarin
parent a1a89dc98e
commit 193e922c9c
11 changed files with 21 additions and 36 deletions

View File

@@ -22,9 +22,8 @@ struct RelayConfigView: View {
var recommended: [RelayDescriptor] {
let rs: [RelayDescriptor] = []
return BOOTSTRAP_RELAYS.reduce(into: rs) { (xs, x) in
if let _ = state.pool.get_relay(x) {
} else {
return BOOTSTRAP_RELAYS.reduce(into: rs) { xs, x in
if state.pool.get_relay(x) == nil {
xs.append(RelayDescriptor(url: URL(string: x)!, info: .rw))
}
}