Commit a97d115
authored
Refactor async.fs. (#9341)
* Remove redundant "new" keywords in async.fs.
* Refactor the use of AsyncReturn and (un)fake to produce better IL code.
The calls to fake() are everywhere inlined and translated to an ldnull. The calls to unfake were replaced by ignore.
The (un)fake functions inside the AsyncPrimitives module were already properly inlined and were not changed.
And remove a branch in Trampoline.Execute.
* Avoid allocating an option in Async.Parallel.
* Remove AsyncActivation.CallExceptionContinuation.
It is identical with AsyncActivation.econt.
* Add a test for cancelling an Async by ThrowingIfRequested.
* Remove a double inversion of a variable.
Use parameterless Action delegates in cancellation event handlers.1 parent f863112 commit a97d115
2 files changed
Lines changed: 81 additions & 79 deletions
File tree
- src/fsharp/FSharp.Core
- tests/FSharp.Core.UnitTests/FSharp.Core/Microsoft.FSharp.Control
0 commit comments