Skip to content

Commit 27dad48

Browse files
committed
Slightly simpler size calculation in Random.rand!
1 parent a0cd812 commit 27dad48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/generation.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function Random.rand!(
5656
@GC.preserve A begin
5757
p = pointer(A)
5858
p = Base.unsafe_convert(Ptr{UInt8}, p)
59-
buf = unsafe_wrap(Vector{UInt8}, p, length(A) * sizeof(T), own=false)
59+
buf = unsafe_wrap(Vector{UInt8}, p, sizeof(A), own=false)
6060

6161
_fill_buffer!(buf, rng)
6262
end

0 commit comments

Comments
 (0)