Refine code style

This commit is contained in:
Mygod
2020-08-18 05:25:32 +08:00
parent 35055bc074
commit 1029728f22
11 changed files with 14 additions and 20 deletions

View File

@@ -97,7 +97,7 @@ data class IpNeighbour(val ip: InetAddress, val dev: String, val lladdr: MacAddr
devs.map { IpNeighbour(ip, it, lladdr, state) }
} catch (e: Exception) {
Timber.w(IllegalArgumentException("Unable to parse line: $line", e))
emptyList<IpNeighbour>()
emptyList()
}
}
@@ -138,4 +138,5 @@ data class IpNeighbour(val ip: InetAddress, val dev: String, val lladdr: MacAddr
data class IpDev(val ip: InetAddress, val dev: String) {
override fun toString() = "$ip%$dev"
}
@Suppress("FunctionName")
fun IpDev(neighbour: IpNeighbour) = IpDev(neighbour.ip, neighbour.dev)

View File

@@ -48,7 +48,7 @@ enum class TetherType(@DrawableRes val icon: Int) {
second.getStringArray(it).filterNotNull().map { it.toPattern() }
} catch (_: Resources.NotFoundException) {
Timber.w(Exception("$name not found"))
emptyList<Pattern>()
emptyList()
}
}