We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
fieldtypes_cached
1 parent 05d418d commit 41b31a6Copy full SHA for 41b31a6
src/visit.jl
@@ -62,9 +62,9 @@ function fieldtypes_cached(@nospecialize(type))
62
@lock types_cache_lock begin
63
# the equivalent `get!(types_cache, type) do ... end` form is not used because on 1.12 it triggers recompilation
64
cache = get(types_cache, type, missing)
65
- cache !== missing && return
66
- types_cache[type] = fieldtypes_array(type)
67
- return
+ cache !== missing && return cache
+ types_cache[type] = ftypes = fieldtypes_array(type)
+ return ftypes
68
end
69
70
0 commit comments