diff options
author | Ben Harris <ben@tilde.team> | 2020-12-02 00:36:24 -0500 |
---|---|---|
committer | Ben Harris <ben@tilde.team> | 2020-12-02 00:36:24 -0500 |
commit | 36bb28af87e81a9b3cab1abd79d11106cd610f6c (patch) | |
tree | d4648bba69ceb5e20753acf54df51d74cff4731b /lib/Extensions.cs | |
parent | 00c3b51b897c33210679de546eebcd9ec75247a1 (diff) |
update gitignore and run resharper cleanup
Diffstat (limited to 'lib/Extensions.cs')
-rw-r--r-- | lib/Extensions.cs | 9 |
1 files changed, 4 insertions, 5 deletions
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<IEnumerable<T>> Permute<T>(this IEnumerable<T> 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<string> 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 |