We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d72809c commit cb85548Copy full SHA for cb85548
common/src/main/kotlin/com/lambda/util/SimpleTimer.kt
@@ -74,8 +74,8 @@ class SimpleTimer {
74
* @param block the code block to execute if the time has passed.
75
*/
76
fun runIfNotPassed(time: Long, reset: Boolean = true, block: () -> Unit) =
77
- timePassed(time).apply {
78
- if (this) return@apply
+ timePassed(time).also { passed ->
+ if (passed) return@also
79
if (reset) reset()
80
81
block()
0 commit comments