minor refactor
This commit is contained in:
@@ -28,11 +28,9 @@ class Execution(
|
|||||||
thisRef: Any?,
|
thisRef: Any?,
|
||||||
property: KProperty<*>,
|
property: KProperty<*>,
|
||||||
): T {
|
): T {
|
||||||
return parser.parse(
|
return arguments
|
||||||
arguments
|
.single { it.name == name }
|
||||||
.find { it.name == name }!!
|
.let { parser.parse(it.value) }
|
||||||
.value
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
operator fun <T> Argument.SingleOrElse<T>.getValue(
|
operator fun <T> Argument.SingleOrElse<T>.getValue(
|
||||||
@@ -40,7 +38,7 @@ class Execution(
|
|||||||
property: KProperty<*>,
|
property: KProperty<*>,
|
||||||
): T {
|
): T {
|
||||||
return arguments
|
return arguments
|
||||||
.find { it.name == name }
|
.singleOrNull { it.name == name }
|
||||||
?.let { parser.parse(it.value) }
|
?.let { parser.parse(it.value) }
|
||||||
?: other
|
?: other
|
||||||
}
|
}
|
||||||
@@ -50,7 +48,7 @@ class Execution(
|
|||||||
property: KProperty<*>,
|
property: KProperty<*>,
|
||||||
): T? {
|
): T? {
|
||||||
return arguments
|
return arguments
|
||||||
.find { it.name == name }
|
.singleOrNull { it.name == name }
|
||||||
?.let { parser.parse(it.value) }
|
?.let { parser.parse(it.value) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user