Skip to content

Commit 3435e1e

Browse files
committed
Faster type promotion
1 parent 746ed96 commit 3435e1e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/variables.jl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ function _varmap_to_vars(varmap::Dict, varlist; defaults=Dict(), check=false, to
7575
for (p, v) in pairs(varmap)
7676
varmap[p] = fixpoint_sub(v, varmap)
7777
end
78-
T′ = eltype(values(varmap))
79-
T = Base.isconcretetype(T′) ? T′ : Base.promote_typeof(values(varmap)...)
78+
vs = values(varmap)
79+
T′ = eltype(vs)
80+
T = Base.isconcretetype(T′) ? T′ : float(typeof(first(vs)))
8081
out = Vector{T}(undef, length(varlist))
8182
missingvars = setdiff(varlist, keys(varmap))
8283
check && (isempty(missingvars) || throw_missingvars(missingvars))

0 commit comments

Comments
 (0)