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

Commit 7c2097a

Browse files
committed
修正への追従
初期化判定の重複を解消
1 parent 7617d0d commit 7c2097a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main/kotlin/com/mapk/kmapper/KMapper.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,8 @@ class KMapper<T : Any> private constructor(
128128

129129
private class ArgumentBinder(private val param: ParameterForMap<*>, private val javaGetter: Method) {
130130
fun bindArgument(src: Any, adaptor: ArgumentAdaptor) {
131-
// 初期化済みであれば高コストな取得処理は行わない
132-
if (!adaptor.isInitialized(param.name)) {
133-
// javaGetterを呼び出す方が高速
134-
adaptor.putIfAbsent(param.name, javaGetter.invoke(src)?.let { param.mapObject(it) })
131+
adaptor.putIfAbsent(param.name) {
132+
javaGetter.invoke(src)?.let { param.mapObject(it) }
135133
}
136134
}
137135
}

0 commit comments

Comments
 (0)