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



##########
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:
       Heh we should probably update the style guide to note exactly this - 
that is only an 'optimization' if you have constant-time access to both 
sequences.




----------------------------------------------------------------
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