@@ -599,13 +599,9 @@ namespace Microsoft.FSharp.Collections
599
599
inherit SeqComponentFactory< 'T, 'U> ()
600
600
override __.Create < 'V > ( _result : Result < 'V >) ( next : SeqComponent < 'U , 'V >) : SeqComponent < 'T , 'V > = next.CreateMap map
601
601
602
- and Map2FirstFactory < 'First , 'Second , 'U > ( map : 'First -> 'Second -> 'U , input2 : IEnumerable < 'Second >) =
602
+ and Map2Factory < 'First , 'Second , 'U > ( map : 'First -> 'Second -> 'U , input2 : IEnumerable < 'Second >) =
603
603
inherit SeqComponentFactory< 'First, 'U> ()
604
- override __.Create < 'V > ( result : Result < 'V >) ( next : SeqComponent < 'U , 'V >) : SeqComponent < 'First , 'V > = upcast Map2First ( map, input2, result, next)
605
-
606
- and Map2SecondFactory < 'First , 'Second , 'U > ( map : 'First -> 'Second -> 'U , input1 : IEnumerable < 'First >) =
607
- inherit SeqComponentFactory< 'Second, 'U> ()
608
- override __.Create < 'V > ( result : Result < 'V >) ( next : SeqComponent < 'U , 'V >) : SeqComponent < 'Second , 'V > = upcast Map2Second ( map, input1, result, next)
604
+ override __.Create < 'V > ( result : Result < 'V >) ( next : SeqComponent < 'U , 'V >) : SeqComponent < 'First , 'V > = upcast Map2 ( map, input2, result, next)
609
605
610
606
and Map3Factory < 'First , 'Second , 'Third , 'U > ( map : 'First -> 'Second -> 'Third -> 'U , input2 : IEnumerable < 'Second >, input3 : IEnumerable < 'Third >) =
611
607
inherit SeqComponentFactory< 'First, 'U> ()
@@ -731,7 +727,7 @@ namespace Microsoft.FSharp.Collections
731
727
override __.ProcessNext ( input : 'T ) : bool =
732
728
Helpers.avoidTailCall ( next.ProcessNext ( map input))
733
729
734
- and Map2First < 'First , 'Second , 'U , 'V > ( map : 'First -> 'Second -> 'U , enumerable2 : IEnumerable < 'Second >, result : Result < 'V >, next : SeqComponent < 'U , 'V >) =
730
+ and Map2 < 'First , 'Second , 'U , 'V > ( map : 'First -> 'Second -> 'U , enumerable2 : IEnumerable < 'Second >, result : Result < 'V >, next : SeqComponent < 'U , 'V >) =
735
731
inherit SeqComponent< 'First, 'V>( next)
736
732
737
733
let input2 = enumerable2.GetEnumerator ()
@@ -751,26 +747,6 @@ namespace Microsoft.FSharp.Collections
751
747
finally
752
748
( Helpers.upcastISeqComponent next) .OnDispose ()
753
749
754
- and Map2Second < 'First , 'Second , 'U , 'V > ( map : 'First -> 'Second -> 'U , enumerable1 : IEnumerable < 'First >, result : Result < 'V >, next : SeqComponent < 'U , 'V >) =
755
- inherit SeqComponent< 'Second, 'V>( next)
756
-
757
- let input1 = enumerable1.GetEnumerator ()
758
- let map ' = OptimizedClosures.FSharpFunc<_,_,_>. Adapt map
759
-
760
- override __.ProcessNext ( input : 'Second ) : bool =
761
- if input1.MoveNext () then
762
- Helpers.avoidTailCall ( next.ProcessNext ( map'.Invoke ( input1.Current, input)))
763
- else
764
- result.StopFurtherProcessing ()
765
- false
766
-
767
- interface ISeqComponent with
768
- override __.OnDispose () =
769
- try
770
- input1.Dispose ()
771
- finally
772
- ( Helpers.upcastISeqComponent next) .OnDispose ()
773
-
774
750
and Map3 < 'First , 'Second , 'Third , 'U , 'V > ( map : 'First -> 'Second -> 'Third -> 'U , enumerable2 : IEnumerable < 'Second >, enumerable3 : IEnumerable < 'Third >, result : Result < 'V >, next : SeqComponent < 'U , 'V >) =
775
751
inherit SeqComponent< 'First, 'V>( next)
776
752
@@ -1513,9 +1489,7 @@ namespace Microsoft.FSharp.Collections
1513
1489
let map2 < 'T , 'U , 'V > ( f : 'T -> 'U -> 'V ) ( source1 : seq < 'T >) ( source2 : seq < 'U >) : seq < 'V > =
1514
1490
checkNonNull " source1" source1
1515
1491
checkNonNull " source2" source2
1516
- match source1 with
1517
- | :? SeqComposer.Enumerable.EnumerableBase< 'T> as s -> s.Compose ( SeqComposer.Map2FirstFactory ( f, source2))
1518
- | _ -> source2 |> seqFactory ( SeqComposer.Map2SecondFactory ( f, source1))
1492
+ source1 |> seqFactory ( SeqComposer.Map2Factory ( f, source2))
1519
1493
1520
1494
[<CompiledName( " Map3" ) >]
1521
1495
let map3 f source1 source2 source3 =
0 commit comments