Skip to content
This repository was archived by the owner on Mar 12, 2021. It is now read-only.

Commit ebb8339

Browse files
committed
Simplify reverse signature.
1 parent b451e89 commit ebb8339

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/array.jl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -314,17 +314,13 @@ function _reverse(input::CuVector{T}, output::CuVector{T}) where {T}
314314
return
315315
end
316316

317-
function Base.reverse!(v::CuVector,
318-
start=first(LinearIndices(v)),
319-
stop=last(LinearIndices(v)))
317+
function Base.reverse!(v::CuVector, start=1, stop=length(v))
320318
v′ = view(v, start:stop)
321319
_reverse(v′, v′)
322320
return v
323321
end
324322

325-
function Base.reverse(v::CuVector,
326-
start=first(LinearIndices(v)),
327-
stop=last(LinearIndices(v)))
323+
function Base.reverse(v::CuVector, start=1, stop=length(v))
328324
v′ = similar(v)
329325
start > 1 && copyto!(v′, 1, v, 1, start-1)
330326
_reverse(view(v, start:stop), view(v′, start:stop))

0 commit comments

Comments
 (0)