Skip to content
This repository was archived by the owner on Jan 20, 2023. It is now read-only.

Commit 8c3f8a7

Browse files
committed
簡略化
1 parent e4725f2 commit 8c3f8a7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/main/kotlin/com/mapk/fastkfunction/FastKFunction.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,7 @@ sealed class FastKFunction<T> {
132132
companion object {
133133
@TestOnly
134134
internal fun List<KParameter>.checkParameters() = also {
135-
val requireInstanceParameter = !isEmpty() && this[0].kind != KParameter.Kind.VALUE
136-
137-
if (isEmpty() || (requireInstanceParameter && size == 1))
135+
if (isEmpty() || (this[0].kind != KParameter.Kind.VALUE && size == 1))
138136
throw IllegalArgumentException("This function is not require arguments.")
139137

140138
if (2 <= size && this[1].kind != KParameter.Kind.VALUE)

0 commit comments

Comments
 (0)