converted tabs to spaces
This commit is contained in:
parent
f90e9c3f1a
commit
a820b6f0ae
3 changed files with 14 additions and 9 deletions
|
|
@ -230,18 +230,23 @@ object Actor extends Logging {
|
|||
}
|
||||
}
|
||||
|
||||
/** Starts the specified actor and returns it, useful for:
|
||||
* <pre>val actor = new FooActor
|
||||
/**
|
||||
* Starts the specified actor and returns it, useful for simplifying code such as:
|
||||
* <pre>
|
||||
* val actor = new FooActor
|
||||
* actor.start
|
||||
* //Gets replaced by
|
||||
* </pre>
|
||||
* can be replaced with:
|
||||
* <pre>
|
||||
* import Actor._
|
||||
*
|
||||
* val actor = start(new FooActor)
|
||||
* </pre>
|
||||
* </pre>
|
||||
*/
|
||||
def start[T <: Actor](actor : T) : T = {
|
||||
actor.start
|
||||
actor
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ class TransactionalRef[T](initialOpt: Option[T] = None) extends Transactional {
|
|||
* Necessary to keep from being implicitly converted to Iterable in for comprehensions.
|
||||
*/
|
||||
def withFilter(p: T => Boolean): WithFilter = new WithFilter(p)
|
||||
|
||||
|
||||
class WithFilter(p: T => Boolean) {
|
||||
def map[B](f: T => B): TransactionalRef[B] = self filter p map f
|
||||
def flatMap[B](f: T => TransactionalRef[B]): TransactionalRef[B] = self filter p flatMap f
|
||||
|
|
|
|||
|
|
@ -98,9 +98,9 @@ class TransactionalRefSpec extends Spec with ShouldMatchers {
|
|||
var result = 0
|
||||
|
||||
atomic {
|
||||
for (value <- ref) {
|
||||
result += value
|
||||
}
|
||||
for (value <- ref) {
|
||||
result += value
|
||||
}
|
||||
}
|
||||
|
||||
result should be(3)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue