Skip to content

Commit

Permalink
Fix DEFAULT_PARSERCONTEXT, speed up parsing.
Browse files Browse the repository at this point in the history
Unfortunately this was never updated in #280 to be the correct default, and so has been wrong ever since introduction.
  • Loading branch information
Zentrik authored Jan 4, 2024
1 parent 48e4b21 commit c48d2b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Parser.jl
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ function unparameterize_type(T::Type)
end

# Workaround for slow dynamic dispatch for creating objects
const DEFAULT_PARSERCONTEXT = ParserContext{Dict{String, Any}, Int64, false, nothing}()
const DEFAULT_PARSERCONTEXT = ParserContext{Dict{String, Any}, Int64, true, nothing}()
function _get_parsercontext(dicttype, inttype, allownan, null)
if dicttype == Dict{String, Any} && inttype == Int64 && !allownan
if dicttype == Dict{String, Any} && inttype == Int64 && allownan
DEFAULT_PARSERCONTEXT
else
ParserContext{unparameterize_type(dicttype), inttype, allownan, null}.instance
Expand Down

0 comments on commit c48d2b4

Please sign in to comment.