pseabury / morelinq

Automatically exported from code.google.com/p/morelinq
Apache License 2.0
0 stars 0 forks source link

Buffering #87

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
The use of buffering on Repeat() and Cartesian() is currently commented as a 
TODO. The attached patch:

1. Implements a buffering class that buffers enumerables in memory.
2. Changes Repeat() and Cartesian to use this buffering.
3. Further changes Repeat() to skip this if the count is 0 or 1.
4. Defines an IBufferedEnumerable<T> interfaces, documented as adding a 
buffering guarantee to IEnumerable<T>.
5. Defines two overloads of a method to create such a buffered instance. One of 
which insists that buffering happen even if the source implements 
ICollection<T>. (Otherwise it is assumed that the source already serves as a 
buffer adequately).

In short: Deals with the two TODO items, and brings the advantage of the code 
needed to do so, to the user.

Original issue reported on code.google.com by j...@hackcraft.net on 12 Dec 2013 at 2:46

Attachments:

GoogleCodeExporter commented 9 years ago
Sorry, there was a slight error in the XML documentation. Further patch:

Original comment by j...@hackcraft.net on 12 Dec 2013 at 2:52

Attachments: