Browse Source

Some patterns in using generic virtual methods may cause increases in compilation time and size on disk when used with Microsoft pre-compilation technologies such as NGEN. This bug fix removes those patterns so that Microsoft pre-compilation technologies such as NGEN and the Cloud Compiler work better with the Reactive Extensions library. This change was tested and found to have no noticeable performance impact, other than stabilizing compilation times and the size on disk.

Michal Strehovsky 11 years ago
parent
commit
7ea7fbbe02

+ 1 - 14
Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/Observable/Select.cs

@@ -5,12 +5,7 @@ using System;
 
 namespace System.Reactive.Linq.ObservableImpl
 {
-    abstract class Select<TResult> : Producer<TResult>
-    {
-        public abstract IObservable<TResult2> Omega<TResult2>(Func<TResult, TResult2> selector);
-    }
-
-    class Select<TSource, TResult> : Select<TResult>
+    class Select<TSource, TResult> : Producer<TResult>
     {
         private readonly IObservable<TSource> _source;
         private readonly Func<TSource, TResult> _selector;
@@ -28,14 +23,6 @@ namespace System.Reactive.Linq.ObservableImpl
             _selectorI = selector;
         }
 
-        public override IObservable<TResult2> Omega<TResult2>(Func<TResult, TResult2> selector)
-        {
-            if (_selector != null)
-                return new Select<TSource, TResult2>(_source, x => selector(_selector(x)));
-            else
-                return new Select<TResult, TResult2>(this, selector);
-        }
-
         protected override IDisposable Run(IObserver<TResult> observer, IDisposable cancel, Action<IDisposable> setSink)
         {
             if (_selector != null)

+ 0 - 4
Rx.NET/Source/System.Reactive.Linq/Reactive/Linq/QueryLanguage.StandardSequenceOperators.cs

@@ -770,10 +770,6 @@ namespace System.Reactive.Linq
         public virtual IObservable<TResult> Select<TSource, TResult>(IObservable<TSource> source, Func<TSource, TResult> selector)
         {
 #if !NO_PERF
-            var select = source as Select<TSource>;
-            if (select != null)
-                return select.Omega(selector);
-
             return new Select<TSource, TResult>(source, selector);
 #else
             var s = source as SelectObservable<TSource>;