Update libraries, some lints (#4099)

* Update some plugins

* Fix some miscellaneous lints
This commit is contained in:
Taco
2020-12-08 22:21:08 -05:00
committed by GitHub
parent 08ab7f6aa0
commit c2b8fea291
31 changed files with 42 additions and 59 deletions
@@ -175,10 +175,10 @@ class EpubFile(file: File) : Closeable {
*/
private fun getPathSeparator(): String {
val meta = zip.getEntry("META-INF\\container.xml")
if (meta != null) {
return "\\"
return if (meta != null) {
"\\"
} else {
return "/"
"/"
}
}
@@ -206,10 +206,10 @@ class EpubFile(file: File) : Closeable {
*/
private fun getParentDirectory(path: String): String {
val separatorIndex = path.lastIndexOf(pathSeparator)
if (separatorIndex >= 0) {
return path.substring(0, separatorIndex)
return if (separatorIndex >= 0) {
path.substring(0, separatorIndex)
} else {
return ""
""
}
}
}
@@ -51,10 +51,7 @@ object ImageUtil {
}
private fun ByteArray.compareWith(magic: ByteArray): Boolean {
for (i in magic.indices) {
if (this[i] != magic[i]) return false
}
return true
return magic.indices.none { this[it] != magic[it] }
}
private fun charByteArrayOf(vararg bytes: Int): ByteArray {