Skip to content

Commit d711dd6

Browse files
committed
Added 'GetIndexInterval' for array.
1 parent d98806f commit d711dd6

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
namespace Whathecode.System
2+
{
3+
public static partial class Extensions
4+
{
5+
/// <summary>
6+
/// Returns the interval of the indices.
7+
/// </summary>
8+
/// <typeparam name = "T">Type of the values in the array.</typeparam>
9+
/// <param name = "source">The source for this extension method.</param>
10+
/// <returns>The interval of the indices of the array.</returns>
11+
public static IInterval<int> GetIndexInterval<T>( this T[] source )
12+
{
13+
return new IntInterval( 0, source.Length - 1 );
14+
}
15+
}
16+
}

0 commit comments

Comments
 (0)