chore: lint performance optimization

This includes shadowed variables, unnecessary parameters, layouts with string literals, items that cause performance bottlenecks, and the merge of extension types into only the necessary separate classes.
This commit is contained in:
TwistedUmbrellaX 2024-03-14 09:23:30 -04:00
parent 958aa634b1
commit 37ec165319
111 changed files with 1561 additions and 2091 deletions

View file

@ -1,9 +1,9 @@
package tachiyomi.domain.source.anime.model
sealed class Pin(val code: Int) {
object Unpinned : Pin(0b00)
object Pinned : Pin(0b01)
object Actual : Pin(0b10)
data object Unpinned : Pin(0b00)
data object Pinned : Pin(0b01)
data object Actual : Pin(0b10)
}
inline fun Pins(builder: Pins.PinsBuilder.() -> Unit = {}): Pins {

View file

@ -21,8 +21,8 @@ class LocalAnimeSource(
private val context: Context,
) : AnimeCatalogueSource, UnmeteredSource {
private val POPULAR_FILTERS = AnimeFilterList(AnimeOrderBy.Popular(context))
private val LATEST_FILTERS = AnimeFilterList(AnimeOrderBy.Latest(context))
private val POPULAR_FILTERS = AnimeFilterList(AnimeOrderBy.Popular())
private val LATEST_FILTERS = AnimeFilterList(AnimeOrderBy.Latest())
override val name = "Local anime source"
@ -61,7 +61,7 @@ class LocalAnimeSource(
}
// Filters
override fun getFilterList() = AnimeFilterList(AnimeOrderBy.Popular(context))
override fun getFilterList() = AnimeFilterList(AnimeOrderBy.Popular())
// Unused stuff
override suspend fun getVideoList(episode: SEpisode) =

View file

@ -19,8 +19,8 @@ class LocalMangaSource(
) : CatalogueSource, UnmeteredSource {
private val POPULAR_FILTERS = FilterList(MangaOrderBy.Popular(context))
private val LATEST_FILTERS = FilterList(MangaOrderBy.Latest(context))
private val POPULAR_FILTERS = FilterList(MangaOrderBy.Popular())
private val LATEST_FILTERS = FilterList(MangaOrderBy.Latest())
override val name: String = "Local manga source"
@ -56,7 +56,7 @@ class LocalMangaSource(
}
// Filters
override fun getFilterList() = FilterList(MangaOrderBy.Popular(context))
override fun getFilterList() = FilterList(MangaOrderBy.Popular())
// Unused stuff
override suspend fun getPageList(chapter: SChapter) =

View file

@ -1,14 +1,13 @@
package tachiyomi.source.local.filter.anime
import android.content.Context
import eu.kanade.tachiyomi.animesource.model.AnimeFilter
sealed class AnimeOrderBy(context: Context, selection: Selection) : AnimeFilter.Sort(
sealed class AnimeOrderBy(selection: Selection) : AnimeFilter.Sort(
"Order by",
arrayOf("Title", "Date"),
selection,
) {
class Popular(context: Context) : AnimeOrderBy(context, Selection(0, true))
class Latest(context: Context) : AnimeOrderBy(context, Selection(1, false))
class Popular : AnimeOrderBy(Selection(0, true))
class Latest : AnimeOrderBy(Selection(1, false))
}

View file

@ -1,13 +1,12 @@
package tachiyomi.source.local.filter.manga
import android.content.Context
import eu.kanade.tachiyomi.source.model.Filter
sealed class MangaOrderBy(context: Context, selection: Selection) : Filter.Sort(
sealed class MangaOrderBy(selection: Selection) : Filter.Sort(
"Order by",
arrayOf("Title", "Date"),
selection,
) {
class Popular(context: Context) : MangaOrderBy(context, Selection(0, true))
class Latest(context: Context) : MangaOrderBy(context, Selection(1, false))
class Popular : MangaOrderBy(Selection(0, true))
class Latest : MangaOrderBy(Selection(1, false))
}