[FIR LT] Optimize LighterASTNode.getChildNodeByType
Instead of creating a list first, return the first matching element of the array.
This commit is contained in:
committed by
Space Team
parent
8519053527
commit
dcb200d6d3
+1
-1
@@ -99,7 +99,7 @@ abstract class AbstractLightTreeRawFirBuilder(
|
||||
}
|
||||
|
||||
override fun LighterASTNode.getChildNodeByType(type: IElementType): LighterASTNode? {
|
||||
return this.getChildNodesByType(type).firstOrNull()
|
||||
return getChildrenAsArray().firstOrNull { it?.tokenType == type }
|
||||
}
|
||||
|
||||
override val LighterASTNode?.receiverExpression: LighterASTNode?
|
||||
|
||||
Reference in New Issue
Block a user