Skip to content

Commit

Permalink
[Maintenance] replace listOf() with emptyList()
Browse files Browse the repository at this point in the history
Refactored code to use `emptyList()` instead of `listOf()` for empty list initialization to improve readability.
  • Loading branch information
GrzegorzBobryk committed Sep 22, 2024
1 parent 74f9198 commit c79273a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import kotlin.reflect.KClass
* @throws MissingKoinDefinitionException
*/
@KoinExperimentalAPI
fun Module.verify(extraTypes: List<KClass<*>> = listOf()) {
org.koin.test.verify.Verify.verify(this,extraTypes + androidTypes)
fun Module.verify(extraTypes: List<KClass<*>> = emptyList()) {
org.koin.test.verify.Verify.verify(this, extraTypes + androidTypes)
}

/**
Expand All @@ -38,8 +38,8 @@ fun Module.verify(extraTypes: List<KClass<*>> = listOf()) {
* @throws MissingKoinDefinitionException
*/
@KoinExperimentalAPI
fun Module.androidVerify(extraTypes: List<KClass<*>> = listOf()) {
org.koin.test.verify.Verify.verify(this,extraTypes + androidTypes)
fun Module.androidVerify(extraTypes: List<KClass<*>> = emptyList()) {
org.koin.test.verify.Verify.verify(this, extraTypes + androidTypes)
}

@KoinExperimentalAPI
Expand All @@ -52,4 +52,4 @@ object AndroidVerify {
SavedStateHandle::class,
WorkerParameters::class
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ data class BeanDefinition<T>(
var qualifier: Qualifier? = null,
val definition: Definition<T>,
val kind: Kind,
var secondaryTypes: List<KClass<*>> = listOf(),
var secondaryTypes: List<KClass<*>> = emptyList(),
) {
var callbacks: Callbacks<T> = Callbacks()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import kotlin.reflect.KClass
* @throws MissingKoinDefinitionException
*/
@KoinExperimentalAPI
fun Module.verify(extraTypes: List<KClass<*>> = listOf()) = Verify.verify(this, extraTypes)
fun Module.verify(extraTypes: List<KClass<*>> = emptyList()) = Verify.verify(this, extraTypes)

/**
* Verify a list of Modules
*
* @see Module.verify
*/
@KoinExperimentalAPI
fun List<Module>.verifyAll(extraTypes: List<KClass<*>> = listOf()) {
fun List<Module>.verifyAll(extraTypes: List<KClass<*>> = emptyList()) {
forEach { module -> module.verify(extraTypes) }
}

Expand Down Expand Up @@ -62,7 +62,7 @@ object Verify {
* @param extraTypes allow to declare extra type, to be bound above the existing definitions
* @throws MissingKoinDefinitionException
*/
fun verify(module: Module, extraTypes: List<KClass<*>> = listOf()) {
fun verify(module: Module, extraTypes: List<KClass<*>> = emptyList()) {
val timer = Timer.start()

val verification = Verification(module, extraTypes)
Expand Down

0 comments on commit c79273a

Please sign in to comment.