Skip to content

Commit 317521b

Browse files
committed
Avoid check
1 parent c6b8524 commit 317521b

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/picos_fifos/picos_fifos.ml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ type ready =
88
| Spawn of Fiber.t * (Fiber.t -> unit)
99
| Continue of Fiber.t * (unit, unit) Effect.Deep.continuation
1010
| Resume of Fiber.t * (Exn_bt.t option, unit) Effect.Deep.continuation
11-
| Return of Fiber.t * (unit, unit) Effect.Deep.continuation
11+
| Return of Fiber.Maybe.t * (unit, unit) Effect.Deep.continuation
1212

1313
type t = {
1414
ready : ready Picos_mpscq.t;
@@ -38,7 +38,7 @@ let rec next t =
3838
t.remaining_quota <- t.quota;
3939
Effect.Deep.match_with main fiber t.handler
4040
| Return (fiber, k) ->
41-
t.fiber <- Fiber.Maybe.of_fiber fiber;
41+
t.fiber <- fiber;
4242
t.remaining_quota <- t.quota;
4343
Effect.Deep.continue k ()
4444
| Continue (fiber, k) ->
@@ -124,8 +124,7 @@ let run_fiber ?quota ?fatal_exn_handler:(exnc : _ = raise) fiber main =
124124
Effect.Deep.continue k ()
125125
end
126126
else begin
127-
let fiber = Fiber.Maybe.to_fiber t.fiber in
128-
Picos_mpscq.push t.ready (Return (fiber, k));
127+
Picos_mpscq.push t.ready (Return (t.fiber, k));
129128
next t
130129
end)
131130
and discontinue =

0 commit comments

Comments
 (0)