Update libraries, some lints (#4099)
* Update some plugins * Fix some miscellaneous lints
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user