Skip to content

Commit

Permalink
feat(core): flatten and flattenConcurrently should optimize for Filte…
Browse files Browse the repository at this point in the history
…rMapOperator
  • Loading branch information
TylorS authored and Andre Medeiros committed Apr 14, 2016
1 parent 5c77ff9 commit e1bebff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1273,14 +1273,14 @@ export class Stream<T> implements InternalListener<T> {
}

flatten<R, T extends Stream<R>>(): T {
return <T> new Stream<R>(this._prod instanceof MapOperator ?
return <T> new Stream<R>(this._prod instanceof MapOperator || this._prod instanceof FilterMapOperator ?
new MapFlattenOperator(<MapOperator<R, Stream<R>>> <any> this._prod) :
new FlattenOperator(<Stream<Stream<R>>> <any> this)
);
}

flattenConcurrently<R, T extends Stream<R>>(): T {
return <T> new Stream<R>(this._prod instanceof MapOperator ?
return <T> new Stream<R>(this._prod instanceof MapOperator || this._prod instanceof FilterMapOperator ?
new MapFlattenConcOperator(<MapOperator<R, Stream<R>>> <any> this._prod) :
new FlattenConcOperator(<Stream<Stream<R>>> <any> this)
);
Expand Down

0 comments on commit e1bebff

Please sign in to comment.