Skip to content

Commit

Permalink
Complete previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
atifaziz committed Aug 7, 2020
1 parent 662b3fa commit 57d4c71
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions MoreLinq/SpillSpan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ namespace MoreLinq
using System;
using System.Collections.Generic;
using System.Linq;
using static Optuple;

partial class MoreEnumerable
{
Expand Down Expand Up @@ -56,10 +55,9 @@ partial class MoreEnumerable
if (headerSelector == null) throw new ArgumentNullException(nameof(headerSelector));
if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector));

return source.SpillSpan((h, i) => i == 0 ? Some(h) : default,
default, Some, (a, _) => a,
h => h is (true, var v) ? headerSelector(v)
: throw new InvalidOperationException(),
return source.SpillSpan((_, i) => i == 0,
default, h => h, (a, _) => a,
headerSelector,
(h, e, _) => resultSelector(h, e));
}

Expand Down Expand Up @@ -189,7 +187,7 @@ partial class MoreEnumerable
if (headerSelector == null) throw new ArgumentNullException(nameof(headerSelector));
if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector));

return source.SpillSpan((e, i) => predicate(e, i) ? Some(e) : default,
return source.SpillSpan((e, i) => predicate(e, i) ? (true, e) : default,
empty, seeder, accumulator, headerSelector, resultSelector);
}

Expand Down

0 comments on commit 57d4c71

Please sign in to comment.