From 9ab7b9fa6d7983a943b3f1d87297e23f71756165 Mon Sep 17 00:00:00 2001 From: Vesa Karvonen Date: Mon, 14 Oct 2024 20:04:17 +0300 Subject: [PATCH] Delay pair destructuring to reduce code size --- lib/picos/picos.ocaml5.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/picos/picos.ocaml5.ml b/lib/picos/picos.ocaml5.ml index be3e784c..8cb4ec9a 100644 --- a/lib/picos/picos.ocaml5.ml +++ b/lib/picos/picos.ocaml5.ml @@ -404,9 +404,9 @@ module Computation = struct if try_attach t trigger then begin match Trigger.await trigger with | None -> begin match op with Ignore -> () | Peek -> peek_exn t end - | Some (exn, bt) -> + | Some exn_bt -> unsafe_unsuspend t Backoff.default |> ignore; - Printexc.raise_with_backtrace exn bt + Printexc.raise_with_backtrace (fst exn_bt) (snd exn_bt) end else begin match op with Ignore -> () | Peek -> peek_exn t @@ -657,9 +657,9 @@ module Fiber = struct if Computation.try_attach sleep trigger then match Trigger.await trigger with | None -> () - | Some (exn, bt) -> + | Some exn_bt -> Computation.finish sleep; - Printexc.raise_with_backtrace exn bt + Printexc.raise_with_backtrace (fst exn_bt) (snd exn_bt) (* END FIBER COMMON *) end