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

Commit 3162d19

Browse files
committed
簡略化
1 parent a68b238 commit 3162d19

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/kotlin/com/mapk/core/internal/Functions.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,11 @@ internal fun KParameter.getAliasOrName(): String? = findAnnotation<KParameterAli
2222
* デフォルト引数を用いるかチェックする関数
2323
*/
2424
internal fun KParameter.isUseDefaultArgument(): Boolean {
25-
if (annotations.any { it is KUseDefaultArgument }) {
26-
if (!isOptional) throw IllegalArgumentException(
25+
return annotations.any { it is KUseDefaultArgument }.apply {
26+
if (this && !isOptional) throw IllegalArgumentException(
2727
"Find ${KUseDefaultArgument::class.jvmName}, but it's not has default argument."
2828
)
29-
return true
3029
}
31-
return false
3230
}
3331

3432
@Suppress("UNCHECKED_CAST")

0 commit comments

Comments
 (0)