Changeset 14944
- Timestamp:
- 05/09/17 11:05:39 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Common/3.3/EnumerableExtensions.cs
r14843 r14944 88 88 } 89 89 90 public static IEnumerable<T> TakeEvery<T>(this IEnumerable<T> xs, int nth) {91 int i = 0;92 foreach (var x in xs) {93 if (i % nth == 0) yield return x;94 i++;95 }96 }97 98 90 /// <summary> 99 91 /// Compute the n-ary cartesian product of arbitrarily many sequences: http://blogs.msdn.com/b/ericlippert/archive/2010/06/28/computing-a-cartesian-product-with-linq.aspx
Note: See TracChangeset
for help on using the changeset viewer.