Avoid using return in single-line closures

Signed-off-by: Roopesh Chander <roop@roopc.net>
This commit is contained in:
Roopesh Chander 2019-01-22 01:44:07 +05:30
parent e0798b8a97
commit b22aeaeb20
2 changed files with 2 additions and 4 deletions

View File

@ -243,7 +243,7 @@ extension TunnelEditTableViewController {
cell.placeholderText = tr("tunnelEditPlaceholderTextStronglyRecommended") cell.placeholderText = tr("tunnelEditPlaceholderTextStronglyRecommended")
cell.keyboardType = .numbersAndPunctuation cell.keyboardType = .numbersAndPunctuation
case .dns: case .dns:
cell.placeholderText = tunnelViewModel.peersData.contains(where: { return $0.shouldStronglyRecommendDNS }) ? tr("tunnelEditPlaceholderTextStronglyRecommended") : tr("tunnelEditPlaceholderTextOptional") cell.placeholderText = tunnelViewModel.peersData.contains(where: { $0.shouldStronglyRecommendDNS }) ? tr("tunnelEditPlaceholderTextStronglyRecommended") : tr("tunnelEditPlaceholderTextOptional")
cell.keyboardType = .numbersAndPunctuation cell.keyboardType = .numbersAndPunctuation
case .listenPort, .mtu: case .listenPort, .mtu:
cell.placeholderText = tr("tunnelEditPlaceholderTextAutomatic") cell.placeholderText = tr("tunnelEditPlaceholderTextAutomatic")

View File

@ -130,9 +130,7 @@ class TunnelEditViewController: NSViewController {
selectedActivateOnDemandOption = .none selectedActivateOnDemandOption = .none
} }
onDemandRow.valueOptions = activateOnDemandOptions.map { onDemandRow.valueOptions = activateOnDemandOptions.map { TunnelViewModel.activateOnDemandOptionText(for: $0) }
return TunnelViewModel.activateOnDemandOptionText(for: $0)
}
onDemandRow.selectedOptionIndex = activateOnDemandOptions.firstIndex(of: selectedActivateOnDemandOption)! onDemandRow.selectedOptionIndex = activateOnDemandOptions.firstIndex(of: selectedActivateOnDemandOption)!
} }