فهرست منبع

Modernize some Ix code.

Bart De Smet 6 سال پیش
والد
کامیت
5bc815ee12
26فایلهای تغییر یافته به همراه78 افزوده شده و 229 حذف شده
  1. 17 19
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Catch.cs
  2. 0 4
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Concat.cs
  3. 1 8
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Create.cs
  4. 19 20
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Do.cs
  5. 0 5
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Expand.cs
  6. 0 5
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Finally.cs
  7. 1 11
      Ix.NET/Source/System.Interactive/System/Linq/Operators/For.cs
  8. 0 10
      Ix.NET/Source/System.Interactive/System/Linq/Operators/ForEach.cs
  9. 0 8
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Generate.cs
  10. 0 2
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Hide.cs
  11. 0 13
      Ix.NET/Source/System.Interactive/System/Linq/Operators/If.cs
  12. 0 2
      Ix.NET/Source/System.Interactive/System/Linq/Operators/IsEmpty.cs
  13. 13 14
      Ix.NET/Source/System.Interactive/System/Linq/Operators/OnErrorResumeNext.cs
  14. 0 7
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Publish.cs
  15. 0 4
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Repeat.cs
  16. 0 10
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Scan.cs
  17. 0 5
      Ix.NET/Source/System.Interactive/System/Linq/Operators/SelectMany.cs
  18. 12 30
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Share.cs
  19. 0 5
      Ix.NET/Source/System.Interactive/System/Linq/Operators/SkipLast.cs
  20. 0 2
      Ix.NET/Source/System.Interactive/System/Linq/Operators/StartsWith.cs
  21. 0 5
      Ix.NET/Source/System.Interactive/System/Linq/Operators/TakeLast.cs
  22. 0 2
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Throw.cs
  23. 4 10
      Ix.NET/Source/System.Interactive/System/Linq/Operators/Using.cs
  24. 0 5
      Ix.NET/Source/System.Interactive/System/Linq/Operators/While.cs
  25. 9 15
      Ix.NET/Source/System.Interactive/System/Linq/RefCountList.cs
  26. 2 8
      Ix.NET/Source/System.Interactive/System/Linq/Yielder.cs

+ 17 - 19
Ix.NET/Source/System.Interactive/System/Linq/Operators/Catch.cs

@@ -116,33 +116,31 @@ namespace System.Linq
 
             foreach (var source in sources)
             {
-                using (var e = source.GetEnumerator())
+                using var e = source.GetEnumerator();
+                error = null;
+
+                while (true)
                 {
-                    error = null;
+                    var c = default(TSource);
 
-                    while (true)
+                    try
                     {
-                        var c = default(TSource);
-
-                        try
-                        {
-                            if (!e.MoveNext())
-                                break;
-
-                            c = e.Current;
-                        }
-                        catch (Exception ex)
-                        {
-                            error = ex;
+                        if (!e.MoveNext())
                             break;
-                        }
 
-                        yield return c;
+                        c = e.Current;
                     }
-
-                    if (error == null)
+                    catch (Exception ex)
+                    {
+                        error = ex;
                         break;
+                    }
+
+                    yield return c;
                 }
+
+                if (error == null)
+                    break;
             }
 
             if (error != null)

+ 0 - 4
Ix.NET/Source/System.Interactive/System/Linq/Operators/Concat.cs

@@ -17,9 +17,7 @@ namespace System.Linq
         public static IEnumerable<TSource> Concat<TSource>(this IEnumerable<IEnumerable<TSource>> sources)
         {
             if (sources == null)
-            {
                 throw new ArgumentNullException(nameof(sources));
-            }
 
             return ConcatCore(sources);
         }
@@ -33,9 +31,7 @@ namespace System.Linq
         public static IEnumerable<TSource> Concat<TSource>(params IEnumerable<TSource>[] sources)
         {
             if (sources == null)
-            {
                 throw new ArgumentNullException(nameof(sources));
-            }
 
             return ConcatCore(sources);
         }

+ 1 - 8
Ix.NET/Source/System.Interactive/System/Linq/Operators/Create.cs

@@ -18,9 +18,7 @@ namespace System.Linq
         public static IEnumerable<TResult> Create<TResult>(Func<IEnumerator<TResult>> getEnumerator)
         {
             if (getEnumerator == null)
-            {
                 throw new ArgumentNullException(nameof(getEnumerator));
-            }
 
             return new AnonymousEnumerable<TResult>(getEnumerator);
         }
@@ -37,9 +35,7 @@ namespace System.Linq
         public static IEnumerable<T> Create<T>(Action<IYielder<T>> create)
         {
             if (create == null)
-            {
                 throw new ArgumentNullException(nameof(create));
-            }
 
             foreach (var x in new Yielder<T>(create))
             {
@@ -51,10 +47,7 @@ namespace System.Linq
         {
             private readonly Func<IEnumerator<TResult>> _getEnumerator;
 
-            public AnonymousEnumerable(Func<IEnumerator<TResult>> getEnumerator)
-            {
-                _getEnumerator = getEnumerator;
-            }
+            public AnonymousEnumerable(Func<IEnumerator<TResult>> getEnumerator) => _getEnumerator = getEnumerator;
 
             public IEnumerator<TResult> GetEnumerator() => _getEnumerator();
 

+ 19 - 20
Ix.NET/Source/System.Interactive/System/Linq/Operators/Do.cs

@@ -108,31 +108,30 @@ namespace System.Linq
 
         private static IEnumerable<TSource> DoCore<TSource>(IEnumerable<TSource> source, Action<TSource> onNext, Action<Exception> onError, Action onCompleted)
         {
-            using (var e = source.GetEnumerator())
+            using var e = source.GetEnumerator();
+
+            while (true)
             {
-                while (true)
+                TSource current;
+                try
+                {
+                    if (!e.MoveNext())
+                        break;
+
+                    current = e.Current;
+                }
+                catch (Exception ex)
                 {
-                    var current = default(TSource);
-                    try
-                    {
-                        if (!e.MoveNext())
-                            break;
-
-                        current = e.Current;
-                    }
-                    catch (Exception ex)
-                    {
-                        onError(ex);
-                        throw;
-                    }
-
-                    onNext(current);
-
-                    yield return current;
+                    onError(ex);
+                    throw;
                 }
 
-                onCompleted();
+                onNext(current);
+
+                yield return current;
             }
+
+            onCompleted();
         }
     }
 }

+ 0 - 5
Ix.NET/Source/System.Interactive/System/Linq/Operators/Expand.cs

@@ -18,14 +18,9 @@ namespace System.Linq
         public static IEnumerable<TSource> Expand<TSource>(this IEnumerable<TSource> source, Func<TSource, IEnumerable<TSource>> selector)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
-
             if (selector == null)
-            {
                 throw new ArgumentNullException(nameof(selector));
-            }
 
             return ExpandCore(source, selector);
         }

+ 0 - 5
Ix.NET/Source/System.Interactive/System/Linq/Operators/Finally.cs

@@ -18,14 +18,9 @@ namespace System.Linq
         public static IEnumerable<TSource> Finally<TSource>(this IEnumerable<TSource> source, Action finallyAction)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
-
             if (finallyAction == null)
-            {
                 throw new ArgumentNullException(nameof(finallyAction));
-            }
 
             return FinallyCore(source, finallyAction);
         }

+ 1 - 11
Ix.NET/Source/System.Interactive/System/Linq/Operators/For.cs

@@ -23,21 +23,11 @@ namespace System.Linq
         public static IEnumerable<TResult> For<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, IEnumerable<TResult>> resultSelector)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
-
             if (resultSelector == null)
-            {
                 throw new ArgumentNullException(nameof(resultSelector));
-            }
-
-            return ForCore(source, resultSelector).Concat();
-        }
 
-        private static IEnumerable<IEnumerable<TResult>> ForCore<TSource, TResult>(IEnumerable<TSource> source, Func<TSource, IEnumerable<TResult>> resultSelector)
-        {
-            return source.Select(resultSelector);
+            return source.Select(resultSelector).Concat();
         }
     }
 }

+ 0 - 10
Ix.NET/Source/System.Interactive/System/Linq/Operators/ForEach.cs

@@ -17,14 +17,9 @@ namespace System.Linq
         public static void ForEach<TSource>(this IEnumerable<TSource> source, Action<TSource> onNext)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
-
             if (onNext == null)
-            {
                 throw new ArgumentNullException(nameof(onNext));
-            }
 
             foreach (var item in source)
             {
@@ -41,14 +36,9 @@ namespace System.Linq
         public static void ForEach<TSource>(this IEnumerable<TSource> source, Action<TSource, int> onNext)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
-
             if (onNext == null)
-            {
                 throw new ArgumentNullException(nameof(onNext));
-            }
 
             var i = 0;
             foreach (var item in source)

+ 0 - 8
Ix.NET/Source/System.Interactive/System/Linq/Operators/Generate.cs

@@ -21,19 +21,11 @@ namespace System.Linq
         public static IEnumerable<TResult> Generate<TState, TResult>(TState initialState, Func<TState, bool> condition, Func<TState, TState> iterate, Func<TState, TResult> resultSelector)
         {
             if (condition == null)
-            {
                 throw new ArgumentNullException(nameof(condition));
-            }
-
             if (iterate == null)
-            {
                 throw new ArgumentNullException(nameof(iterate));
-            }
-
             if (resultSelector == null)
-            {
                 throw new ArgumentNullException(nameof(resultSelector));
-            }
 
             return GenerateCore(initialState, condition, iterate, resultSelector);
         }

+ 0 - 2
Ix.NET/Source/System.Interactive/System/Linq/Operators/Hide.cs

@@ -21,9 +21,7 @@ namespace System.Linq
         public static IEnumerable<TSource> Hide<TSource>(this IEnumerable<TSource> source)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
 
             return HideCore(source);
         }

+ 0 - 13
Ix.NET/Source/System.Interactive/System/Linq/Operators/If.cs

@@ -19,19 +19,11 @@ namespace System.Linq
         public static IEnumerable<TResult> If<TResult>(Func<bool> condition, IEnumerable<TResult> thenSource, IEnumerable<TResult> elseSource)
         {
             if (condition == null)
-            {
                 throw new ArgumentNullException(nameof(condition));
-            }
-
             if (thenSource == null)
-            {
                 throw new ArgumentNullException(nameof(thenSource));
-            }
-
             if (elseSource == null)
-            {
                 throw new ArgumentNullException(nameof(elseSource));
-            }
 
             return Defer(() => condition() ? thenSource : elseSource);
         }
@@ -47,14 +39,9 @@ namespace System.Linq
         public static IEnumerable<TResult> If<TResult>(Func<bool> condition, IEnumerable<TResult> thenSource)
         {
             if (condition == null)
-            {
                 throw new ArgumentNullException(nameof(condition));
-            }
-
             if (thenSource == null)
-            {
                 throw new ArgumentNullException(nameof(thenSource));
-            }
 
             return Defer(() => condition() ? thenSource : Enumerable.Empty<TResult>());
         }

+ 0 - 2
Ix.NET/Source/System.Interactive/System/Linq/Operators/IsEmpty.cs

@@ -17,9 +17,7 @@ namespace System.Linq
         public static bool IsEmpty<TSource>(this IEnumerable<TSource> source)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
 
             return !source.Any();
         }

+ 13 - 14
Ix.NET/Source/System.Interactive/System/Linq/Operators/OnErrorResumeNext.cs

@@ -59,25 +59,24 @@ namespace System.Linq
         {
             foreach (var source in sources)
             {
-                using (var innerEnumerator = source.GetEnumerator())
+                using var innerEnumerator = source.GetEnumerator();
+
+                while (true)
                 {
-                    while (true)
+                    var value = default(TSource);
+                    try
                     {
-                        var value = default(TSource);
-                        try
-                        {
-                            if (!innerEnumerator.MoveNext())
-                                break;
-
-                            value = innerEnumerator.Current;
-                        }
-                        catch
-                        {
+                        if (!innerEnumerator.MoveNext())
                             break;
-                        }
 
-                        yield return value;
+                        value = innerEnumerator.Current;
                     }
+                    catch
+                    {
+                        break;
+                    }
+
+                    yield return value;
                 }
             }
         }

+ 0 - 7
Ix.NET/Source/System.Interactive/System/Linq/Operators/Publish.cs

@@ -35,9 +35,7 @@ namespace System.Linq
         public static IBuffer<TSource> Publish<TSource>(this IEnumerable<TSource> source)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
 
             return new PublishedBuffer<TSource>(source.GetEnumerator());
         }
@@ -54,14 +52,9 @@ namespace System.Linq
         public static IEnumerable<TResult> Publish<TSource, TResult>(this IEnumerable<TSource> source, Func<IEnumerable<TSource>, IEnumerable<TResult>> selector)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
-
             if (selector == null)
-            {
                 throw new ArgumentNullException(nameof(selector));
-            }
 
             return Create(() => selector(source.Publish()).GetEnumerator());
         }

+ 0 - 4
Ix.NET/Source/System.Interactive/System/Linq/Operators/Repeat.cs

@@ -43,9 +43,7 @@ namespace System.Linq
         public static IEnumerable<TSource> Repeat<TSource>(this IEnumerable<TSource> source)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
 
             return RepeatCore(source);
         }
@@ -60,9 +58,7 @@ namespace System.Linq
         public static IEnumerable<TSource> Repeat<TSource>(this IEnumerable<TSource> source, int count)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
 
             if (count < 0)
             {

+ 0 - 10
Ix.NET/Source/System.Interactive/System/Linq/Operators/Scan.cs

@@ -23,14 +23,9 @@ namespace System.Linq
         public static IEnumerable<TAccumulate> Scan<TSource, TAccumulate>(this IEnumerable<TSource> source, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> accumulator)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
-
             if (accumulator == null)
-            {
                 throw new ArgumentNullException(nameof(accumulator));
-            }
 
             return ScanCore(source, seed, accumulator);
         }
@@ -48,14 +43,9 @@ namespace System.Linq
         public static IEnumerable<TSource> Scan<TSource>(this IEnumerable<TSource> source, Func<TSource, TSource, TSource> accumulator)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
-
             if (accumulator == null)
-            {
                 throw new ArgumentNullException(nameof(accumulator));
-            }
 
             return ScanCore(source, accumulator);
         }

+ 0 - 5
Ix.NET/Source/System.Interactive/System/Linq/Operators/SelectMany.cs

@@ -19,14 +19,9 @@ namespace System.Linq
         public static IEnumerable<TOther> SelectMany<TSource, TOther>(this IEnumerable<TSource> source, IEnumerable<TOther> other)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
-
             if (other == null)
-            {
                 throw new ArgumentNullException(nameof(other));
-            }
 
             return source.SelectMany(_ => other);
         }

+ 12 - 30
Ix.NET/Source/System.Interactive/System/Linq/Operators/Share.cs

@@ -2,11 +2,8 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-using System;
 using System.Collections;
 using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
 
 namespace System.Linq
 {
@@ -56,8 +53,7 @@ namespace System.Linq
             if (selector == null)
                 throw new ArgumentNullException(nameof(selector));
 
-            return Create(() => selector(source.Share())
-                              .GetEnumerator());
+            return Create(() => selector(source.Share()).GetEnumerator());
         }
 
         private class SharedBuffer<T> : IBuffer<T>
@@ -100,32 +96,21 @@ namespace System.Linq
                 }
             }
 
-            private IEnumerator<T> GetEnumerator_()
-            {
-                return new ShareEnumerator(this);
-            }
+            private IEnumerator<T> GetEnumerator_() => new ShareEnumerator(this);
 
-            sealed class ShareEnumerator : IEnumerator<T>
+            private sealed class ShareEnumerator : IEnumerator<T>
             {
-                readonly SharedBuffer<T> _parent;
-
-                T _current;
+                private readonly SharedBuffer<T> _parent;
 
-                bool _disposed;
+                private bool _disposed;
 
-                public ShareEnumerator(SharedBuffer<T> parent)
-                {
-                    _parent = parent;
-                }
+                public ShareEnumerator(SharedBuffer<T> parent) => _parent = parent;
 
-                public T Current => _current;
+                public T Current { get; private set; }
 
-                object IEnumerator.Current => _current;
+                object IEnumerator.Current => Current;
 
-                public void Dispose()
-                {
-                    _disposed = true;
-                }
+                public void Dispose() => _disposed = true;
 
                 public bool MoveNext()
                 {
@@ -145,7 +130,7 @@ namespace System.Linq
                         hasValue = src.MoveNext();
                         if (hasValue)
                         {
-                            _current = src.Current;
+                            Current = src.Current;
                         }
                     }
                     if (hasValue)
@@ -153,14 +138,11 @@ namespace System.Linq
                         return true;
                     }
                     _disposed = true;
-                    _current = default(T);
+                    Current = default;
                     return false;
                 }
 
-                public void Reset()
-                {
-                    throw new NotSupportedException();
-                }
+                public void Reset() => throw new NotSupportedException();
             }
         }
     }

+ 0 - 5
Ix.NET/Source/System.Interactive/System/Linq/Operators/SkipLast.cs

@@ -22,14 +22,9 @@ namespace System.Linq
         public static IEnumerable<TSource> SkipLast<TSource>(this IEnumerable<TSource> source, int count)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
-
             if (count < 0)
-            {
                 throw new ArgumentOutOfRangeException(nameof(count));
-            }
 
             return SkipLastCore(source, count);
         }

+ 0 - 2
Ix.NET/Source/System.Interactive/System/Linq/Operators/StartsWith.cs

@@ -18,9 +18,7 @@ namespace System.Linq
         public static IEnumerable<TSource> StartWith<TSource>(this IEnumerable<TSource> source, params TSource[] values)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
 
             return StartWithCore(source, values);
         }

+ 0 - 5
Ix.NET/Source/System.Interactive/System/Linq/Operators/TakeLast.cs

@@ -19,14 +19,9 @@ namespace System.Linq
         public static IEnumerable<TSource> TakeLast<TSource>(this IEnumerable<TSource> source, int count)
         {
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
-
             if (count < 0)
-            {
                 throw new ArgumentOutOfRangeException(nameof(count));
-            }
 
             return TakeLastCore(source, count);
         }

+ 0 - 2
Ix.NET/Source/System.Interactive/System/Linq/Operators/Throw.cs

@@ -17,9 +17,7 @@ namespace System.Linq
         public static IEnumerable<TResult> Throw<TResult>(Exception exception)
         {
             if (exception == null)
-            {
                 throw new ArgumentNullException(nameof(exception));
-            }
 
             return ThrowCore<TResult>(exception);
         }

+ 4 - 10
Ix.NET/Source/System.Interactive/System/Linq/Operators/Using.cs

@@ -20,26 +20,20 @@ namespace System.Linq
         public static IEnumerable<TSource> Using<TSource, TResource>(Func<TResource> resourceFactory, Func<TResource, IEnumerable<TSource>> enumerableFactory) where TResource : IDisposable
         {
             if (resourceFactory == null)
-            {
                 throw new ArgumentNullException(nameof(resourceFactory));
-            }
-
             if (enumerableFactory == null)
-            {
                 throw new ArgumentNullException(nameof(enumerableFactory));
-            }
 
             return UsingCore(resourceFactory, enumerableFactory);
         }
 
         private static IEnumerable<TSource> UsingCore<TSource, TResource>(Func<TResource> resourceFactory, Func<TResource, IEnumerable<TSource>> enumerableFactory) where TResource : IDisposable
         {
-            using (var res = resourceFactory())
+            using var res = resourceFactory();
+
+            foreach (var item in enumerableFactory(res))
             {
-                foreach (var item in enumerableFactory(res))
-                {
-                    yield return item;
-                }
+                yield return item;
             }
         }
     }

+ 0 - 5
Ix.NET/Source/System.Interactive/System/Linq/Operators/While.cs

@@ -18,14 +18,9 @@ namespace System.Linq
         public static IEnumerable<TResult> While<TResult>(Func<bool> condition, IEnumerable<TResult> source)
         {
             if (condition == null)
-            {
                 throw new ArgumentNullException(nameof(condition));
-            }
-
             if (source == null)
-            {
                 throw new ArgumentNullException(nameof(source));
-            }
 
             return WhileCore(condition, source).Concat();
         }

+ 9 - 15
Ix.NET/Source/System.Interactive/System/Linq/RefCountList.cs

@@ -9,31 +9,25 @@ namespace System.Linq
 {
     internal sealed class RefCountList<T> : IRefCountList<T>
     {
-        private int _readerCount;
         private readonly IDictionary<int, RefCount> _list;
-        private int _count;
 
         public RefCountList(int readerCount)
         {
-            _readerCount = readerCount;
+            ReaderCount = readerCount;
             _list = new Dictionary<int, RefCount>();
         }
 
-        public int ReaderCount
-        {
-            get => _readerCount;
-            set => _readerCount = value;
-        }
+        public int ReaderCount { get; set; }
 
         public void Clear() => _list.Clear();
 
-        public int Count => _count;
+        public int Count { get; private set; }
 
         public T this[int i]
         {
             get
             {
-                Debug.Assert(i < _count);
+                Debug.Assert(i < Count);
 
                 if (!_list.TryGetValue(i, out var res))
                     throw new InvalidOperationException("Element no longer available in the buffer.");
@@ -51,19 +45,19 @@ namespace System.Linq
 
         public void Add(T item)
         {
-            _list[_count] = new RefCount { Value = item, Count = _readerCount };
+            _list[Count] = new RefCount { Value = item, Count = ReaderCount };
 
-            _count++;
+            Count++;
         }
 
         public void Done(int index)
         {
-            for (var i = index; i < _count; i++)
+            for (var i = index; i < Count; i++)
             {
-                var ignore = this[i];
+                _ = this[i];
             }
 
-            _readerCount--;
+            ReaderCount--;
         }
 
         private sealed class RefCount

+ 2 - 8
Ix.NET/Source/System.Interactive/System/Linq/Yielder.cs

@@ -14,10 +14,7 @@ namespace System.Linq
         private bool _running;
         private bool _stopped;
 
-        public Yielder(Action<Yielder<T>> create)
-        {
-            _create = create;
-        }
+        public Yielder(Action<Yielder<T>> create) => _create = create;
 
         public T Current { get; private set; }
 
@@ -71,9 +68,6 @@ namespace System.Linq
             return !_stopped && _hasValue;
         }
 
-        public void Reset()
-        {
-            throw new NotSupportedException();
-        }
+        public void Reset() => throw new NotSupportedException();
     }
 }