@@ -15,7 +15,7 @@ trait Collection:
1515
1616 /** Returns `true` iff `self` is empty. */
1717 def isEmpty : Boolean =
18- startPosition `eq` endPosition
18+ startPosition eq endPosition
1919
2020 /** Returns the number of elements in `self`.
2121 *
@@ -25,7 +25,7 @@ trait Collection:
2525 def count : Int =
2626 val e = endPosition
2727 def loop (p : Position , n : Int ): Int =
28- if p `eq` e then n else loop(self.positionAfter(p), n + 1 )
28+ if p eq e then n else loop(self.positionAfter(p), n + 1 )
2929 loop(startPosition, 0 )
3030
3131 /** Returns the position of `self`'s first element', or `endPosition` if `self` is empty.
@@ -70,12 +70,12 @@ trait Collection:
7070 */
7171 def isBefore (i : Position , j : Position ): Boolean =
7272 val e = self.endPosition
73- if i `eq` e then false
74- else if j `eq` e then true
73+ if i eq e then false
74+ else if j eq e then true
7575 else
7676 def recur (n : Position ): Boolean =
77- if n `eq` j then true
78- else if n `eq` e then false
77+ if n eq j then true
78+ else if n eq e then false
7979 else recur(self.positionAfter(n))
8080 recur(self.positionAfter(i))
8181
@@ -110,7 +110,7 @@ extension [Self: Collection](self: Self)
110110 else
111111 val p = self.startPosition
112112 val q = self.positionAfter(p)
113- val t = Slice (self, Range (q, self.endPosition, (a, b) => (a `eq` b) || self.isBefore(a, b)))
113+ val t = Slice (self, Range (q, self.endPosition, (a, b) => (a eq b) || self.isBefore(a, b)))
114114 Some ((self.at(p), t))
115115
116116 def headAndTail2 : Option [(Self .Element , Self .Slice2 )] =
@@ -119,7 +119,7 @@ extension [Self: Collection](self: Self)
119119 else
120120 val p = self.startPosition
121121 val q = self.positionAfter(p)
122- val t = Self .Slice2 (self, Range (q, self.endPosition, (a, b) => (a `eq` b) || self.isBefore(a, b)))
122+ val t = Self .Slice2 (self, Range (q, self.endPosition, (a, b) => (a eq b) || self.isBefore(a, b)))
123123 Some ((self.at(p), t))
124124
125125 /** Applies `combine` on `partialResult` and each element of `self`, in order.
@@ -130,7 +130,7 @@ extension [Self: Collection](self: Self)
130130 def reduce [T ](partialResult : T )(combine : (T , Self .Element ) => T ): T =
131131 val e = self.endPosition
132132 def loop (p : Self .Position , r : T ): T =
133- if p `eq` e then r
133+ if p eq e then r
134134 else loop(self.positionAfter(p), combine(r, self.at(p)))
135135 loop(self.startPosition, partialResult)
136136
@@ -146,7 +146,7 @@ extension [Self: Collection](self: Self)
146146 def forEach (action : Self .Element => Boolean ): Boolean =
147147 val e = self.endPosition
148148 def loop (p : Self .Position ): Boolean =
149- if p `eq` e then true
149+ if p eq e then true
150150 else if ! action(self.at(p)) then false
151151 else loop(self.positionAfter(p))
152152 loop(self.startPosition)
@@ -194,7 +194,7 @@ extension [Self: Collection](self: Self)
194194 def firstPositionWhere (predicate : Self .Element => Boolean ): Option [Self .Position ] =
195195 val e = self.endPosition
196196 def loop (p : Self .Position ): Option [Self .Position ] =
197- if p `eq` e then None
197+ if p eq e then None
198198 else if predicate(self.at(p)) then Some (p)
199199 else loop(self.positionAfter(p))
200200 loop(self.startPosition)
@@ -243,7 +243,7 @@ extension [Self: Collection](self: Self)
243243 else
244244 val e = self.endPosition
245245 def loop (p : Self .Position , least : Self .Element ): Self .Element =
246- if p `eq` e then
246+ if p eq e then
247247 least
248248 else
249249 val x = self.at(p)
@@ -255,9 +255,9 @@ extension [Self: Collection](self: Self)
255255 /** Returns `true` if `self` contains the same elements as `other`, in the same order. */
256256 def elementsEqual [T : Collection { type Element = Self .Element } ](other : T ): Boolean =
257257 def loop (i : Self .Position , j : T .Position ): Boolean =
258- if i `eq` self.endPosition then
259- j `eq` other.endPosition
260- else if j `eq` other.endPosition then
258+ if i eq self.endPosition then
259+ j eq other.endPosition
260+ else if j eq other.endPosition then
261261 false
262262 else if self.at(i) `neq` other.at(j)then
263263 false
0 commit comments