From 2f3e984cb5c9b2de83c572cc1cc6c866f2db0e37 Mon Sep 17 00:00:00 2001 From: Daniel Spiewak Date: Sat, 24 Jul 2021 16:02:22 -0600 Subject: [PATCH] Make off-by-one errors slightly less likely --- .../src/main/scala/cats/effect/unsafe/IORuntimeConfig.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/shared/src/main/scala/cats/effect/unsafe/IORuntimeConfig.scala b/core/shared/src/main/scala/cats/effect/unsafe/IORuntimeConfig.scala index 885479bc6c..54f7c407b0 100644 --- a/core/shared/src/main/scala/cats/effect/unsafe/IORuntimeConfig.scala +++ b/core/shared/src/main/scala/cats/effect/unsafe/IORuntimeConfig.scala @@ -80,7 +80,7 @@ object IORuntimeConfig extends IORuntimeConfigCompanionPlatform { cancelationCheckThreshold, autoYieldThreshold, enhancedExceptions, - 2 << (Math.round(Math.log(traceBufferSize.toDouble) / Math.log(2)).toInt - 1)) + 1 << Math.round(Math.log(traceBufferSize.toDouble) / Math.log(2)).toInt) else throw new AssertionError( s"Auto yield threshold $autoYieldThreshold must be a multiple of cancelation check threshold $cancelationCheckThreshold")