You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2019/05/01 15:21:47 UTC

[GitHub] [spark] 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

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org