HyukjinKwon commented on a change in pull request #29529:
URL: https://github.com/apache/spark/pull/29529#discussion_r475676736



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/SpecificInternalRow.scala
##########
@@ -208,10 +208,9 @@ final class SpecificInternalRow(val values: 
Array[MutableValue]) extends BaseGen
   def this(dataTypes: Seq[DataType]) = {
     // SPARK-32550: use while loop instead of map
     this(new Array[MutableValue](dataTypes.length))
-    val length = values.length
     var i = 0
-    while (i < length) {
-      values(i) = dataTypeToMutableValue(dataTypes(i))
+    dataTypes.foreach { dt =>

Review comment:
       Let's also add a short comment. Using plan while is actually recommanded 
per the guide at 
https://github.com/databricks/scala-style-guide#traversal-and-zipwithindex so 
it's likely people attempt to use while here in the future




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to