Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Fold should accept an array of events #409

Closed
wants to merge 5 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
superfluous array
  • Loading branch information
nordfjord committed Jul 23, 2023
commit fac658ef027c2e20900dfdf7a402df9ee90de1fd
7 changes: 3 additions & 4 deletions src/Equinox/Core.fs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ type internal Impl() =
(mapResult: Func<'r, struct (StreamToken * 's), 'v>)
originTokenAndState ct: Task<'v> =
let rec loop attempt tokenAndState: Task<'v> = task {
let! result, events = decide.Invoke(tokenAndState, ct)
match Array.ofSeq events with
| [||] -> return mapResult.Invoke(result, tokenAndState)
| events ->
match! decide.Invoke(tokenAndState, ct) with
| result, [||] -> return mapResult.Invoke(result, tokenAndState)
| result, events ->
match! stream.TrySync(attempt, tokenAndState, events, ct) with
| SyncResult.Written tokenAndState' ->
return mapResult.Invoke(result, tokenAndState')
Expand Down