From f1f776b974fab6467d2997b4488af580b305202d Mon Sep 17 00:00:00 2001 From: "Steven G. Johnson" Date: Tue, 25 Jul 2023 15:24:49 -0400 Subject: [PATCH] ensure int keys in rulecache --- src/gausskronrod.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gausskronrod.jl b/src/gausskronrod.jl index e22a397..f010474 100644 --- a/src/gausskronrod.jl +++ b/src/gausskronrod.jl @@ -558,8 +558,8 @@ const rulecache = Dict{Type,Dict}( const bigrulecache = Dict{Tuple{Int,Int}, NTuple{3,Vector{BigFloat}}}() function cachedrule(::Union{Type{BigFloat},Type{Complex{BigFloat}}}, n::Integer) - key = (n, precision(BigFloat)) - haskey(bigrulecache, key) ? bigrulecache[key] : (bigrulecache[key] = kronrod(BigFloat, n)) + key = (Int(n), precision(BigFloat)) + haskey(bigrulecache, key) ? bigrulecache[key] : (bigrulecache[key] = kronrod(BigFloat, Int(n))) end # use a generated function to make this type-stable