Browse Source

Adding some comment to Select.

Bart De Smet 8 years ago
parent
commit
243d99b61c
1 changed files with 5 additions and 0 deletions
  1. 5 0
      Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Select.cs

+ 5 - 0
Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Select.cs

@@ -435,6 +435,11 @@ namespace System.Linq
             }
         }
 
+        // NB: LINQ to Objects implements IPartition<TResult> for this. However, it seems incorrect to do so in a trivial
+        //     manner where e.g. TryGetLast simply indexes into the list without running the selector for the first n - 1
+        //     elements in order to ensure side-effects. We should consider whether we want to follow this implementation
+        //     strategy or support IAsyncPartition<TResult> in a less efficient but more correct manner here.
+
         internal sealed class SelectIListIteratorWithTask<TSource, TResult> : AsyncIterator<TResult>, IAsyncIListProvider<TResult>
         {
             private readonly Func<TSource, Task<TResult>> selector;