File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4848
4949Base. getindex (x:: _UnsafeVectorView , i:: CartesianIndex{1} ) = getindex (x, i[1 ])
5050
51- function Base. setindex! (x:: _UnsafeVectorView{T} , value:: T , i:: Integer ) where {T}
51+ function Base. setindex! (x:: _UnsafeVectorView , value, i:: Integer )
52+ # We don't need to worry about `value` being the right type here because
53+ # x.ptr is a `::Ptr{T}`, so even though it is called `unsafe_store!`, there
54+ # is still a type convertion that happens so that we're not just chucking
55+ # the bits of value into `x.ptr`.
5256 unsafe_store! (x. ptr, value, i + x. offset)
5357 return value
5458end
5559
56- function Base. setindex! (x:: _UnsafeVectorView{T} , value, i:: Integer ) where {T}
57- return setindex! (x, convert (T, value), i)
58- end
59-
6060function Base. setindex! (x:: _UnsafeVectorView , value, i:: CartesianIndex{1} )
6161 return setindex! (x, value, i[1 ])
6262end
You can’t perform that action at this time.
0 commit comments