srowen commented on a change in pull request #24494: [SPARK-27586][SQL] Improve 
binary comparison: replace Scala's for-comprehension if statements with while 
loop
URL: https://github.com/apache/spark/pull/24494#discussion_r280105429
 
 

 ##########
 File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/util/TypeUtils.scala
 ##########
 @@ -73,7 +73,7 @@ object TypeUtils {
   }
 
   def compareBinary(x: Array[Byte], y: Array[Byte]): Int = {
-    val limit = math.min(x.length, y.length)
+    val limit = if (x.length <= y.length) x.length else y.length
 
 Review comment:
   How about just a `min`?

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


With regards,
Apache Git Services

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

Reply via email to