Skip to content

Commit 38ac128

Browse files
committed
Simplify is_target_varname
1 parent 2025ef9 commit 38ac128

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/mcmc/gibbs.jl

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,7 @@ function get_conditioned_gibbs(context::GibbsContext, vns::AbstractArray{<:VarNa
129129
return map(Base.Fix1(get_conditioned_gibbs, context), vns)
130130
end
131131

132-
function is_target_varname(context::GibbsContext, vn::VarName)
133-
return is_target_varname(context, DynamicPPL.getsym(vn))
134-
end
135-
136-
is_target_varname(::GibbsContext{T}, vn_symbol::Symbol) where {T} = vn_symbol in T
132+
is_target_varname(::GibbsContext{VNs}, ::VarName{sym}) where {VNs,sym} = sym in VNs
137133

138134
function is_target_varname(context::GibbsContext, vns::AbstractArray{<:VarName})
139135
num_target = count(Iterators.map(Base.Fix1(is_target_varname, context), vns))

0 commit comments

Comments
 (0)