Browse Source

remove SteppedRange (#980)

af/merge-core
Simon Cropp 7 years ago
committed by Anton Firsov
parent
commit
8bbb9e0466
  1. 27
      src/ImageSharp/Common/Extensions/EnumerableExtensions.cs

27
src/ImageSharp/Common/Extensions/EnumerableExtensions.cs

@ -11,33 +11,6 @@ namespace SixLabors.ImageSharp.Common
/// </summary>
internal static class EnumerableExtensions
{
/// <summary>
/// Generates a sequence of integral numbers within a specified range.
/// </summary>
/// <param name="fromInclusive">
/// The start index, inclusive.
/// </param>
/// <param name="toExclusive">
/// The end index, exclusive.
/// </param>
/// <param name="step">
/// The incremental step.
/// </param>
/// <returns>
/// The <see cref="IEnumerable{Int32}"/> that contains a range of sequential integral numbers.
/// </returns>
public static IEnumerable<int> SteppedRange(int fromInclusive, int toExclusive, int step)
{
// Borrowed from Enumerable.Range
long num = (fromInclusive + toExclusive) - 1L;
if ((toExclusive < 0) || (num > 0x7fffffffL))
{
throw new ArgumentOutOfRangeException(nameof(toExclusive));
}
return RangeIterator(fromInclusive, i => i < toExclusive, step);
}
/// <summary>
/// Generates a sequence of integral numbers within a specified range.
/// </summary>

Loading…
Cancel
Save