From 4b2b41e725dcf29b9f6e59f385492c05d9896212 Mon Sep 17 00:00:00 2001 From: Roland Date: Tue, 13 Dec 2011 11:20:36 +0100 Subject: [PATCH] fix two comments from Patrik MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - map Iterable to Vector using breakOut instead of «Vector() ++ ...» - give a name to the Pi sample actor system --- _mb/mailbox_user__b | Bin 0 -> 302 bytes .../src/main/scala/akka/routing/Routing.scala | 2 +- .../akka-tutorial-first/src/main/scala/Pi.scala | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 _mb/mailbox_user__b diff --git a/_mb/mailbox_user__b b/_mb/mailbox_user__b new file mode 100644 index 0000000000000000000000000000000000000000..009c77d26baa56ae61e3ce9493066d1b479cd7a9 GIT binary patch literal 302 zcmZRoVqjocE_Kh$gpmObxRkjR6SK1ut@QO>N{bSca#DR0Gjo#iD}oDBll4oBQ;YOf zl7!^AxYoR7U@c)_E-uX#639v{OVrCr%uCk`E-A{)OIISokYq+SkfluX7#J9KkmU$h zE^Uw_ii;S;KrYrxOfJbU(hJDXEY8mh$jr%6naC*}kntn>C=&xiMS&0wMM?@>av<&4 MJ)BpXlLK)m0DHMt-2eap literal 0 HcmV?d00001 diff --git a/akka-actor/src/main/scala/akka/routing/Routing.scala b/akka-actor/src/main/scala/akka/routing/Routing.scala index 8fdfb8d9eb..d96f9cb5f1 100644 --- a/akka-actor/src/main/scala/akka/routing/Routing.scala +++ b/akka-actor/src/main/scala/akka/routing/Routing.scala @@ -81,7 +81,7 @@ trait RouterConfig { protected def createRoutees(props: Props, context: ActorContext, nrOfInstances: Int, targets: Iterable[String]): Vector[ActorRef] = (nrOfInstances, targets) match { case (0, Nil) ⇒ throw new IllegalArgumentException("Insufficient information - missing configuration.") case (x, Nil) ⇒ (1 to x).map(_ ⇒ context.actorOf(props))(scala.collection.breakOut) - case (_, xs) ⇒ Vector.empty[ActorRef] ++ xs.map(context.actorFor(_)) + case (_, xs) ⇒ xs.map(context.actorFor(_))(scala.collection.breakOut) } } diff --git a/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala b/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala index 6634eef783..76461d82e9 100644 --- a/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala +++ b/akka-tutorials/akka-tutorial-first/src/main/scala/Pi.scala @@ -87,7 +87,7 @@ object Pi extends App { // ===== Run it ===== // ================== def calculate(nrOfWorkers: Int, nrOfElements: Int, nrOfMessages: Int) { - val system = ActorSystem() + val system = ActorSystem("PiSystem") // this latch is only plumbing to know when the calculation is completed val latch = new CountDownLatch(1)