Skip to content

Commit 5501485

Browse files
committed
fix undefined reference error when type widening
1 parent c7efc8a commit 5501485

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/sample.jl

+5-3
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ function mcmcsample(
8181
callback(rng, model, sampler, transition, 1)
8282

8383
# Save the transition.
84-
transitions = AbstractMCMC.transitions(transition, model, sampler, N; kwargs...)
85-
transitions = save!!(transitions, transition, 1, model, sampler, N; kwargs...)
84+
transitions = [transition]
85+
Base.sizehint!(transitions, N)
8686

8787
# Update the progress bar.
8888
progress && ProgressLogging.@logprogress 1/N
@@ -96,7 +96,9 @@ function mcmcsample(
9696
callback(rng, model, sampler, transition, i)
9797

9898
# Save the transition.
99-
transitions = save!!(transitions, transition, i, model, sampler, N; kwargs...)
99+
oldT = typeof(transitions)
100+
transitions = save!!(transitions, transition, i, model, sampler)
101+
oldT !== typeof(transitions) && Base.sizehint!(transitions, N)
100102

101103
# Update the progress bar.
102104
progress && ProgressLogging.@logprogress i/N

0 commit comments

Comments
 (0)