From 36bb28af87e81a9b3cab1abd79d11106cd610f6c Mon Sep 17 00:00:00 2001 From: Ben Harris Date: Wed, 2 Dec 2020 00:36:24 -0500 Subject: update gitignore and run resharper cleanup --- lib/Extensions.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/Extensions.cs') diff --git a/lib/Extensions.cs b/lib/Extensions.cs index 3c81f17..a1ffbcc 100644 --- a/lib/Extensions.cs +++ b/lib/Extensions.cs @@ -1,5 +1,4 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; namespace aoc2019.lib @@ -8,13 +7,13 @@ namespace aoc2019.lib { public static IEnumerable> Permute(this IEnumerable list) { - if (list.Count() == 1) return new[] { list }; + if (list.Count() == 1) return new[] {list}; return list.SelectMany(t => Permute(list.Where(x => !x.Equals(t))), (v, p) => p.Prepend(v)); } public static IEnumerable Chunk(this string str, int chunkSize) { - for (int i = 0; i < str.Length; i += chunkSize) + for (var i = 0; i < str.Length; i += chunkSize) yield return str.Substring(i, chunkSize); } @@ -30,4 +29,4 @@ namespace aoc2019.lib yield return item; } } -} +} \ No newline at end of file -- cgit 1.4.1