Skip to content

Commit cb85548

Browse files
committed
Timer refactor
1 parent d72809c commit cb85548

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

common/src/main/kotlin/com/lambda/util/SimpleTimer.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ class SimpleTimer {
7474
* @param block the code block to execute if the time has passed.
7575
*/
7676
fun runIfNotPassed(time: Long, reset: Boolean = true, block: () -> Unit) =
77-
timePassed(time).apply {
78-
if (this) return@apply
77+
timePassed(time).also { passed ->
78+
if (passed) return@also
7979
if (reset) reset()
8080

8181
block()

0 commit comments

Comments
 (0)