Skip to content

Commit

Permalink
Update wsample.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
Tortar authored Oct 28, 2024
1 parent 00cfb8a commit 31fa6ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/wsample.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ function wsample_single(a, w, wsum)
stop_w = rand() * wsum
partial_w = 0.0
j = 1
for i in 1:length(w)
@inbounds partial_w += w[i]
for i in eachindex(w)
partial_w += w[i]
if partial_w > stop_w
j = i
break
Expand Down

0 comments on commit 31fa6ea

Please sign in to comment.