Clean up table rendering a bit

This commit is contained in:
Patrik Svensson
2021-01-02 09:05:49 +01:00
committed by Patrik Svensson
parent c6210f75ca
commit 179e243214
11 changed files with 683 additions and 501 deletions

View File

@ -6,6 +6,23 @@ namespace Spectre.Console.Internal
{
internal static class EnumerableExtensions
{
public static int IndexOf<T>(this IEnumerable<T> source, T item)
where T : class
{
var index = 0;
foreach (var candidate in source)
{
if (candidate == item)
{
return index;
}
index++;
}
return -1;
}
public static int GetCount<T>(this IEnumerable<T> source)
{
if (source is IList<T> list)