attilapiros commented on a change in pull request #24241: 
[SPARK-27323][CORE][SQL][STREAMING] Use Single-Abstract-Method support in Scala 
2.12 to simplify code
URL: https://github.com/apache/spark/pull/24241#discussion_r270997509
 
 

 ##########
 File path: 
streaming/src/main/scala/org/apache/spark/streaming/scheduler/ReceiverTracker.scala
 ##########
 @@ -255,9 +255,7 @@ class ReceiverTracker(ssc: StreamingContext, 
skipReceiverLaunch: Boolean = false
     }
   }
 
-  def numReceivers(): Int = {
-    receiverInputStreams.size
-  }
+  def numReceivers(): Int = receiverInputStreams.length
 
 Review comment:
   This fine (I just would like to help for the next reviewer), so the reason 
of this change:
   
   >Replace .size with .length on arrays and strings
   >
   >Inspection info: This inspection reports array.size and string.size calls. 
While such calls are legitimate, they require an additional implicit conversion 
to SeqLike to be made. A common use case would be calling length on arrays and 
strings may provide significant advantages.
   

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