Explorar o código

improve syntax

Co-authored-by: bjoern <r10s@b44t.com>
cyBerta %!s(int64=2) %!d(string=hai) anos
pai
achega
2250626226
Modificáronse 1 ficheiros con 1 adicións e 4 borrados
  1. 1 4
      deltachat-ios/Controller/WebViewViewController.swift

+ 1 - 4
deltachat-ios/Controller/WebViewViewController.swift

@@ -215,10 +215,7 @@ class WebViewViewController: UIViewController, WKNavigationDelegate {
         // workaround:
         let contacts: [Int] = dcContext.getContacts(flags: DC_GCL_ADD_SELF, queryString: emailAddress)
         let index = contacts.firstIndex(where: { dcContext.getContact(id: $0).email == emailAddress }) ?? -1
-        var contactId = 0
-        if index >= 0 {
-            contactId = contacts[index]
-        }
+        let contactId = index >= 0 ? contacts[index] : 0
 
         if contactId == 0 {
             let alert = UIAlertController(title: String.localizedStringWithFormat(String.localized("ask_start_chat_with"), emailAddress),