Get rid of redundant boxing

This commit is contained in:
2024-11-09 19:11:41 +02:00
parent 3b173dc6fc
commit 3ffcefaa1b
2 changed files with 8 additions and 6 deletions

View File

@@ -632,14 +632,14 @@ internal class HitomiLaParser(context: MangaLoaderContext) : MangaParser(context
// / --->
private var scriptLastRetrieval: Long? = null
private var scriptLastRetrieval: Long = -1L
private val mutex = Mutex()
private var subdomainOffsetDefault = 0
private val subdomainOffsetMap = mutableMapOf<Int, Int>()
private var commonImageId = ""
private suspend fun refreshScript() = mutex.withLock {
if (scriptLastRetrieval == null || (scriptLastRetrieval!! + 60000) < System.currentTimeMillis()) {
if (scriptLastRetrieval == -1L || (scriptLastRetrieval + 60000) < System.currentTimeMillis()) {
val ggScript = webClient.httpGet("$ltnBaseUrl/gg.js?_=${System.currentTimeMillis()}").parseRaw()
subdomainOffsetDefault = Regex("var o = (\\d)").find(ggScript)!!.groupValues[1].toInt()

View File

@@ -213,6 +213,8 @@ internal abstract class WebtoonsParser(
state = null,
source = source,
),
date = 0L,
readCount = 0L,
)
}
}
@@ -331,9 +333,9 @@ internal abstract class WebtoonsParser(
}
}
private inner class MangaWebtoon(
val manga: Manga,
@JvmField val date: Long? = null,
@JvmField val readCount: Long? = null, // FIXME get rid of boxing
private class MangaWebtoon(
@JvmField val manga: Manga,
@JvmField val date: Long,
@JvmField val readCount: Long,
)
}