File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
packages/effect/src/internal Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " effect " : patch
3+ ---
4+
5+ backport Effect.gen optimization
Original file line number Diff line number Diff line change @@ -194,10 +194,20 @@ const contOpSuccess = {
194194 cont : core . FromIterator ,
195195 value : unknown
196196 ) => {
197- const state = internalCall ( ( ) => cont . effect_instruction_i0 . next ( value ) )
198- if ( state . done ) return core . exitSucceed ( state . value )
199- self . pushStack ( cont )
200- return yieldWrapGet ( state . value )
197+ while ( true ) {
198+ const state = internalCall ( ( ) => cont . effect_instruction_i0 . next ( value ) )
199+ if ( state . done ) {
200+ return core . exitSucceed ( state . value )
201+ }
202+ const primitive = yieldWrapGet ( state . value )
203+ if ( ! core . exitIsExit ( primitive ) ) {
204+ self . pushStack ( cont )
205+ return primitive
206+ } else if ( primitive . _tag === "Failure" ) {
207+ return primitive
208+ }
209+ value = primitive . value
210+ }
201211 }
202212}
203213
You can’t perform that action at this time.
0 commit comments