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

Commit 208052d

Browse files
committed
operator fun化とそれに伴う改名
1 parent b88ebc6 commit 208052d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/main/kotlin/com/mapk/fastkfunction/argumentbucket/ArgumentBucket.kt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@ class ArgumentBucket(
1818

1919
fun getValueArray(): Array<Any?> = valueArrayGetter(valueArray)
2020

21-
fun put(key: KParameter, value: Any?): Any? {
21+
operator fun set(key: KParameter, value: Any?): Any? {
2222
return valueArray[key.index].apply {
2323
valueArray[key.index] = value
2424
initializationStatuses[key.index] = true
2525
}
2626
}
2727

28-
fun put(index: Int, value: Any?): Any? {
28+
operator fun set(index: Int, value: Any?): Any? {
2929
return valueArray[index].apply {
3030
valueArray[index] = value
3131
initializationStatuses[index] = true
3232
}
3333
}
3434

35-
fun putIfAbsent(key: KParameter, value: Any?): Any? {
35+
fun setIfAbsent(key: KParameter, value: Any?): Any? {
3636
return if (initializationStatuses[key.index])
3737
valueArray[key.index]
3838
else
@@ -42,7 +42,7 @@ class ArgumentBucket(
4242
}
4343
}
4444

45-
fun putIfAbsent(index: Int, value: Any?): Any? {
45+
fun setIfAbsent(index: Int, value: Any?): Any? {
4646
return if (initializationStatuses[index])
4747
valueArray[index]
4848
else

src/test/kotlin/com/mapk/fastkfunction/fastkfunction/FullInitializedCallTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ private class FullInitializedCallTest {
5353
val bucket = sut.generateBucket().apply {
5454
val params = target.parameters.filter { it.kind == KParameter.Kind.VALUE }
5555

56-
put(params[0], 100)
57-
put(params[1], "txt")
56+
set(params[0], 100)
57+
set(params[1], "txt")
5858
}
5959

6060
assertDoesNotThrow("Fail $message") {

src/test/kotlin/com/mapk/fastkfunction/fastkfunction/UseDefaultValueCallTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ private class UseDefaultValueCallTest {
9595
val bucket = sut.generateBucket().apply {
9696
val params = target.parameters.filter { it.kind == KParameter.Kind.VALUE && !it.isOptional }
9797

98-
put(params[0], 100)
99-
put(params[1], "txt")
98+
set(params[0], 100)
99+
set(params[1], "txt")
100100
}
101101

102102
assertDoesNotThrow("Fail ${default.name}") {

0 commit comments

Comments
 (0)