fix(common): mark CommentNode#findTopMostParent as tailrec

This commit is contained in:
Harsh Shandilya 2024-05-04 03:55:30 +05:30
parent 5061843779
commit 8735f7f8e8

View file

@ -71,7 +71,7 @@ internal fun setExpanded(commentNode: CommentNode, expanded: Boolean): CommentNo
return commentNode
}
internal fun findTopMostParent(node: CommentNode): CommentNode {
internal tailrec fun findTopMostParent(node: CommentNode): CommentNode {
val parent = node.parent
return if (parent != null) {
findTopMostParent(parent)