perf: inline checkInterrupted

Amazingly, the extra result allocation seems to have triggered a mathlib
heartbeat timeout
This commit is contained in:
Sebastian Ullrich 2023-10-12 14:05:00 +02:00
parent d3bc2ac1a9
commit 9874848f83

View file

@ -199,7 +199,7 @@ instance [MetaEval α] : MetaEval (CoreM α) where
protected def withIncRecDepth [Monad m] [MonadControlT CoreM m] (x : m α) : m α :=
controlAt CoreM fun runInBase => withIncRecDepth (runInBase x)
def checkInterrupted : CoreM Unit := do
@[inline] def checkInterrupted : CoreM Unit := do
if (← IO.checkCanceled) then
-- should never be visible to users!
throw <| Exception.error .missing "elaboration interrupted"