Skip to content

Commit 1b30485

Browse files
committed
make 'zip(that, selector)' public and rename to 'zipWith'
1 parent 3c90565 commit 1b30485

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

language-adaptors/rxjava-scala/src/main/scala/rx/lang/scala/Observable.scala

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -385,18 +385,16 @@ trait Observable[+T]
385385
* is the minumum of the number of `onNext` invocations of `this` and `that`.
386386
*/
387387
def zip[U](that: Observable[U]): Observable[(T, U)] = {
388-
zip(that, (t: T, u: U) => (t, u))
388+
zipWith(that, (t: T, u: U) => (t, u))
389389
}
390390

391391
/**
392392
* Returns an Observable formed from this Observable and another Observable by combining
393393
* corresponding elements using the selector function.
394394
* The number of `onNext` invocations of the resulting `Observable[(T, U)]`
395395
* is the minumum of the number of `onNext` invocations of `this` and `that`.
396-
*
397-
* Note that this function is private because Scala collections don't have such a function.
398396
*/
399-
private def zip[U, R](that: Observable[U], selector: (T,U) => R): Observable[R] = {
397+
def zipWith[U, R](that: Observable[U], selector: (T,U) => R): Observable[R] = {
400398
toScalaObservable[R](rx.Observable.zip[T, U, R](this.asJavaObservable, that.asJavaObservable, selector))
401399
}
402400

0 commit comments

Comments
 (0)