Skip to content

Commit

Permalink
Refine code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Mygod committed May 7, 2021
1 parent e79c67e commit 491f814
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions mobile/src/main/java/be/mygod/vpnhotspot/client/MacLookup.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import be.mygod.vpnhotspot.R
import be.mygod.vpnhotspot.net.MacAddressCompat
import be.mygod.vpnhotspot.room.AppDatabase
import be.mygod.vpnhotspot.widget.SmartSnackbar
import kotlinx.coroutines.*
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import org.json.JSONException
import org.json.JSONObject
import timber.log.Timber
Expand All @@ -33,9 +36,7 @@ object MacLookup {
@MainThread
fun abort(mac: MacAddressCompat) = macLookupBusy.remove(mac)?.let { (conn, job) ->
job.cancel()
if (Build.VERSION.SDK_INT < 26) GlobalScope.launch(Dispatchers.IO) {
conn.disconnect()
} else conn.disconnect()
if (Build.VERSION.SDK_INT < 26) GlobalScope.launch(Dispatchers.IO) { conn.disconnect() } else conn.disconnect()
}

@MainThread
Expand Down

0 comments on commit 491f814

Please sign in to comment.