Skip to content

Commit

Permalink
Remove dependence on MemberwiseClone. TODO: check if this is approach…
Browse files Browse the repository at this point in the history
… is more performant
  • Loading branch information
abelbraaksma committed Oct 29, 2022
1 parent 43f311d commit e982267
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/FSharpy.TaskSeq/TaskSeqBuilder.fs
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,9 @@ and [<NoComparison; NoEquality>] TaskSeq<'Machine, 'T
//
// Solution: we shadow the initial machine, which we then re-assign here:
//
let clone = this.MemberwiseClone() :?> TaskSeq<'Machine, 'T>
clone._machine <- clone._initialMachine
let clone = TaskSeq<'Machine, 'T>() // we used MemberwiseClone, TODO: test difference in perf, but this should be faster
clone._machine <- this._initialMachine
clone._initialMachine <- this._initialMachine // TODO: proof with a test that this is necessary: probably not
clone.InitMachineData(ct, &clone._machine)
clone

Expand Down

0 comments on commit e982267

Please sign in to comment.