Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/11/17 15:55:44 (7 years ago)
Author:
gkronber
Message:

#2697: applied r14390, r14391, r14393, r14394, r14396 again (resolving conflicts)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Common/3.3/EnumerableExtensions.cs

    r14769 r14843  
    8888    }
    8989
     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
    9098    /// <summary>
    9199    /// 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.