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

Commit 34b42d9

Browse files
committed
Instance parameter関連まで追加
1 parent 1612cf2 commit 34b42d9

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,27 @@ val result: Sample = fastKFunction.generateBucket()
3535
.apply { (0 until 5).forEach { this[it] = it + 1 }}
3636
.let { fastKFunction.callBy(it) }
3737
```
38+
39+
## Installation
40+
TODO
41+
42+
## How to use FastKFunction.
43+
44+
### Instance parameter.
45+
If you call an instance function, you can expect a faster call with `instance parameter`.
46+
47+
```kotlin
48+
data class Sample(
49+
val arg1: Int,
50+
val arg2: Int
51+
) {
52+
fun instanceFun(arg3: Int): Int = arg1 + arg2 + arg3
53+
}
54+
55+
val sample = Sample(1, 2)
56+
57+
val fastKFunction = FastKFunction(sample::instanceFun, sample)
58+
```
59+
60+
Depending on how you get the `KFunction`, the `instance parameter` may be required.
61+
Even if the `instance parameter` is not required, passing an `instance parameter` will make the call faster.

0 commit comments

Comments
 (0)