From 0f1520c7985d0649a392a020116d0185ad970528 Mon Sep 17 00:00:00 2001 From: Gibran Chevalley Date: Fri, 13 Dec 2024 12:34:41 +0100 Subject: [PATCH] refactor: Add tailrec annotation to the recursive findActivity method --- .../main/java/com/infomaniak/core2/compose/core/ScreenUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Core2/Compose/Core/src/main/java/com/infomaniak/core2/compose/core/ScreenUtils.kt b/Core2/Compose/Core/src/main/java/com/infomaniak/core2/compose/core/ScreenUtils.kt index 7042599c8..92e5209c5 100644 --- a/Core2/Compose/Core/src/main/java/com/infomaniak/core2/compose/core/ScreenUtils.kt +++ b/Core2/Compose/Core/src/main/java/com/infomaniak/core2/compose/core/ScreenUtils.kt @@ -39,7 +39,7 @@ fun LockScreenOrientation(isLocked: Boolean) { } } -private fun Context.findActivity(): Activity? = when (this) { +private tailrec fun Context.findActivity(): Activity? = when (this) { is Activity -> this is ContextWrapper -> baseContext.findActivity() else -> null