Skip to content

Commit

Permalink
addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kiszk committed May 23, 2016
1 parent 5bdfaa7 commit 74d8764
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,11 @@ case class NewInstance(
override def doGenCode(ctx: CodegenContext, ev: ExprCode): ExprCode = {
val javaType = ctx.javaType(dataType)
val argIsNulls = ctx.freshName("argIsNulls")
ctx.addMutableState("boolean[]", argIsNulls, "")
val argTypes = arguments.map(e => ctx.javaType(e.dataType))
ctx.addMutableState("boolean[]", argIsNulls,
s"$argIsNulls = new boolean[${arguments.size}];")
val argValues = arguments.zipWithIndex.map { case (e, i) =>
val argValue = ctx.freshName("argValue")
ctx.addMutableState(argTypes(i), argValue, "")
ctx.addMutableState(ctx.javaType(e.dataType), argValue, "")
argValue
}

Expand Down Expand Up @@ -279,7 +279,6 @@ case class NewInstance(
}

val code = s"""
$argIsNulls = new boolean[${arguments.size}];
${argCode.mkString("")}
${outer.map(_.code).getOrElse("")}
$setIsNull
Expand Down

0 comments on commit 74d8764

Please sign in to comment.