Skip to content

Commit 928cd15

Browse files
committed
Fix formatting and comments
1 parent 7bf9201 commit 928cd15

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/main/scala/viper/silver/ast/utility/Traversable.scala

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,20 @@ trait Traversable[+A] {
1919
def withFilter(p: A => Boolean): Traversable[A] = new WithFilter(p)
2020

2121
class WithFilter(p: A => Boolean) extends Traversable[A] {
22-
/** Applies a function to all filtered element of the outer collection. */
22+
/** Applies a function to all filtered elements of the outer collection. */
2323
def foreach[U](f: A => U): Unit = {
2424
for (x <- self) {
2525
if (p(x)) f(x)
2626
}
2727
}
2828

2929
/** Further refines the filter of this collection. */
30-
override def withFilter(q: A => Boolean): WithFilter = new WithFilter(x => p(x) && q(x))
30+
override def withFilter(q: A => Boolean): WithFilter = {
31+
new WithFilter(x => p(x) && q(x))
32+
}
3133
}
3234

33-
/** Finds the first element of the $coll for which the given partial
35+
/** Finds the first element of this collection for which the given partial
3436
* function is defined, and applies the partial function to it.
3537
*/
3638
def collectFirst[B](pf: PartialFunction[A, B]): Option[B] = {
@@ -42,8 +44,8 @@ trait Traversable[+A] {
4244
None
4345
}
4446

45-
/** Builds a new collection by applying a partial function to all elements of this collection on which the function
46-
* is defined.
47+
/** Builds a new collection by applying a partial function to all elements
48+
* of this collection on which the function is defined.
4749
*/
4850
def collect[B](pf: PartialFunction[A, B]): Iterable[B] = {
4951
val elements = mutable.Queue.empty[B]

0 commit comments

Comments
 (0)