Skip to content

Commit c6d4b5e

Browse files
committed
Remove unnecessary extra variable copies
1 parent 2cc4cff commit c6d4b5e

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/higherOrderFunctions.scala

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -135,20 +135,7 @@ case class LambdaFunction(
135135
override def eval(input: InternalRow): Any = function.eval(input)
136136

137137
override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
138-
val functionCode = function.genCode(ctx)
139-
140-
if (nullable) {
141-
ev.copy(code = code"""
142-
|${functionCode.code}
143-
|boolean ${ev.isNull} = ${functionCode.isNull};
144-
|${CodeGenerator.javaType(dataType)} ${ev.value} = ${functionCode.value};
145-
""".stripMargin)
146-
} else {
147-
ev.copy(code = code"""
148-
|${functionCode.code}
149-
|${CodeGenerator.javaType(dataType)} ${ev.value} = ${functionCode.value};
150-
""".stripMargin, isNull = FalseLiteral)
151-
}
138+
function.genCode(ctx)
152139
}
153140

154141
override protected def withNewChildrenInternal(

0 commit comments

Comments
 (0)