Commit cf0ad396 authored by Mygod's avatar Mygod

Refine code style

parent f4ce8b87
...@@ -121,8 +121,8 @@ class LocalDnsServer(private val localResolver: suspend (String) -> Array<InetAd ...@@ -121,8 +121,8 @@ class LocalDnsServer(private val localResolver: suspend (String) -> Array<InetAd
ByteBuffer.wrap(prepareDnsResponse(request).apply { ByteBuffer.wrap(prepareDnsResponse(request).apply {
header.setFlag(Flags.RA.toInt()) // recursion available header.setFlag(Flags.RA.toInt()) // recursion available
for (address in localResults) addRecord(when (address) { for (address in localResults) addRecord(when (address) {
is Inet4Address -> ARecord(request.question.name, DClass.IN, TTL, address) is Inet4Address -> ARecord(question.name, DClass.IN, TTL, address)
is Inet6Address -> AAAARecord(request.question.name, DClass.IN, TTL, address) is Inet6Address -> AAAARecord(question.name, DClass.IN, TTL, address)
else -> throw IllegalStateException("Unsupported address $address") else -> throw IllegalStateException("Unsupported address $address")
}, Section.ANSWER) }, Section.ANSWER)
}.toWire()) }.toWire())
......
...@@ -36,5 +36,5 @@ class DeviceStorageApp(context: Context) : Application() { ...@@ -36,5 +36,5 @@ class DeviceStorageApp(context: Context) : Application() {
* Thou shalt not get the REAL underlying application context which would no longer be operating under device * Thou shalt not get the REAL underlying application context which would no longer be operating under device
* protected storage. * protected storage.
*/ */
override fun getApplicationContext(): Context = this override fun getApplicationContext() = this
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment