Fix code style issues
This commit is contained in:
@@ -28,8 +28,8 @@ fun String.parseNumericAddress(): InetAddress? {
|
||||
}
|
||||
|
||||
fun parsePort(str: String?, default: Int, min: Int = 1025): Int {
|
||||
val x = str?.toIntOrNull() ?: default
|
||||
return if (x < min || x > 65535) default else x
|
||||
val value = str?.toIntOrNull() ?: default
|
||||
return if (value < min || value > 65535) default else value
|
||||
}
|
||||
|
||||
fun broadcastReceiver(callback: (Context, Intent) -> Unit): BroadcastReceiver = object : BroadcastReceiver() {
|
||||
@@ -72,6 +72,6 @@ private class SortedListIterable<out T>(private val list: SortedList<T>) : Itera
|
||||
private class SortedListIterator<out T>(private val list: SortedList<T>) : Iterator<T> {
|
||||
private var count = 0
|
||||
override fun hasNext() = count < list.size()
|
||||
override fun next(): T = list[count++]
|
||||
override fun next(): T = if (hasNext()) list[count++] else throw NoSuchElementException()
|
||||
}
|
||||
fun <T> SortedList<T>.asIterable(): Iterable<T> = SortedListIterable(this)
|
||||
|
||||
Reference in New Issue
Block a user