Skip to content

Commit

Permalink
refactor: Add tailrec annotation to the recursive findActivity method
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarX committed Dec 13, 2024
1 parent d0e77df commit 0f1520c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0f1520c

Please sign in to comment.