Merge "Eliminate lazy indirection, make constant 'const'" into androidx-main
diff --git a/compose/runtime/runtime/src/desktopMain/kotlin/androidx/compose/runtime/ActualDesktop.kt b/compose/runtime/runtime/src/desktopMain/kotlin/androidx/compose/runtime/ActualDesktop.kt
index 3e5c529..c494970 100644
--- a/compose/runtime/runtime/src/desktopMain/kotlin/androidx/compose/runtime/ActualDesktop.kt
+++ b/compose/runtime/runtime/src/desktopMain/kotlin/androidx/compose/runtime/ActualDesktop.kt
@@ -116,15 +116,15 @@
* obtained using [LaunchedEffect] or [rememberCoroutineScope] they also use
* [MonotonicFrameClock] which is bound to the current window.
*/
-actual val DefaultMonotonicFrameClock: MonotonicFrameClock by lazy {
- object : MonotonicFrameClock {
- private val fps = 60
+actual val DefaultMonotonicFrameClock: MonotonicFrameClock get() = SixtyFpsMonotonicFrameClock
- override suspend fun <R> withFrameNanos(
- onFrame: (Long) -> R
- ): R {
- delay(1000L / fps)
- return onFrame(System.nanoTime())
- }
+private object SixtyFpsMonotonicFrameClock : MonotonicFrameClock {
+ private const val fps = 60
+
+ override suspend fun <R> withFrameNanos(
+ onFrame: (Long) -> R
+ ): R {
+ delay(1000L / fps)
+ return onFrame(System.nanoTime())
}
-}
\ No newline at end of file
+}