Option to import manga from directories #31
This commit is contained in:
@@ -25,7 +25,7 @@ inline fun <T> Set(size: Int, init: (index: Int) -> T): Set<T> = when (size) {
|
||||
else -> MutableSet(size, init)
|
||||
}
|
||||
|
||||
fun <T> List<T>.asArrayList(): ArrayList<T> = if (this is ArrayList<*>) {
|
||||
fun <T> Collection<T>.asArrayList(): ArrayList<T> = if (this is ArrayList<*>) {
|
||||
this as ArrayList<T>
|
||||
} else {
|
||||
ArrayList(this)
|
||||
@@ -38,4 +38,4 @@ fun <K, V> Map<K, V>.findKeyByValue(value: V): K? {
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
package org.koitharu.kotatsu.utils.ext
|
||||
|
||||
inline fun Int.ifZero(defaultValue: () -> Int): Int = if (this == 0) defaultValue() else this
|
||||
inline fun Int.ifZero(defaultValue: () -> Int): Int = if (this == 0) defaultValue() else this
|
||||
|
||||
fun longOf(a: Int, b: Int): Long {
|
||||
return a.toLong() shl 32 or (b.toLong() and 0xffffffffL)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user