Skip to content

Commit 517044d

Browse files
committed
refactor: 코틀린의 랜덤을 사용하도록 변경
1 parent 552f961 commit 517044d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
package racingcar
22

3-
import java.util.concurrent.ThreadLocalRandom
3+
import kotlin.random.Random
44

55
object RandomPowerGenerator : PowerGenerator {
66

77
private const val MAX_POWER = 10
88
private const val MIN_POWER = 0
99

10-
private val threadLocalRandom = ThreadLocalRandom.current()
1110

1211
override fun generate(): Int {
13-
return threadLocalRandom.nextInt(MIN_POWER, MAX_POWER)
12+
return Random.nextInt(MIN_POWER, MAX_POWER)
1413
}
1514
}

0 commit comments

Comments
 (0)