Github user srowen commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11113#discussion_r52163789
  
    --- Diff: 
examples/src/main/scala/org/apache/spark/examples/streaming/ActorWordCount.scala
 ---
    @@ -39,7 +39,7 @@ case class UnsubscribeReceiver(receiverActor: ActorRef)
     class FeederActor extends Actor {
     
       val rand = new Random()
    -  var receivers: LinkedList[ActorRef] = new LinkedList[ActorRef]()
    +  var receivers: ArrayBuffer[ActorRef] = new ArrayBuffer[ActorRef]()
    --- End diff --
    
    This could just be `var receivers =ArrayBuffer[ActorRef]()`. In fact it can 
be a `val`; the one other assignment in the line with `dropWhile` is pointless 
for a mutable collection.
    
    I suppose one could argue we should be using some form of linked list with 
O(1) insertion at the head, but given it's an example, I'm not so worried.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

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

Reply via email to