Skip to content

Commit

Permalink
Please fantomas
Browse files Browse the repository at this point in the history
  • Loading branch information
bartelink committed Dec 22, 2023
1 parent 23b596c commit c24fded
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/FSharp.Control.TaskSeq/TaskSeqInternal.fs
Original file line number Diff line number Diff line change
Expand Up @@ -796,20 +796,16 @@ module internal TaskSeqInternal =

let mutable cont = true

let exclusive =
match whileKind with
| Exclusive -> true
| Inclusive -> false

match predicate with
| Predicate predicate -> // skipWhile(Inclusive)?
while cont do
if predicate e.Current then // spam -> skip
let! hasAnother = e.MoveNextAsync()
cont <- hasAnother
else // Starting the ham
if exclusive then
yield e.Current // return the item as it does not meet the condition for skipping
match whileKind with
| Exclusive -> yield e.Current // return the item as it does not meet the condition for skipping
| Inclusive -> ()

while! e.MoveNextAsync() do // propagate the rest
yield e.Current
Expand All @@ -822,8 +818,9 @@ module internal TaskSeqInternal =
let! hasAnother = e.MoveNextAsync()
cont <- hasAnother
| false -> // We're starting the ham
if exclusive then
yield e.Current // Yield the one that just failed the skip test
match whileKind with
| Exclusive -> yield e.Current // return the item as it does not meet the condition for skipping
| Inclusive -> ()

while! e.MoveNextAsync() do // propagate the rest
yield e.Current
Expand Down

0 comments on commit c24fded

Please sign in to comment.