Skip to content

Commit

Permalink
Avoid mutating breaks argument in cut
Browse files Browse the repository at this point in the history
  • Loading branch information
nalimilan committed Jun 13, 2018
1 parent 9d39a2d commit 1667961
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ function cut(x::AbstractArray{T, N}, breaks::AbstractVector;
if extend
min_x, max_x = extrema(x)
if !ismissing(min_x) && breaks[1] > min_x
pushfirst!(breaks, min_x)
breaks = [min_x; breaks]
end
if !ismissing(max_x) && breaks[end] < max_x
push!(breaks, max_x)
breaks = [breaks; max_x]
end
end

Expand Down

0 comments on commit 1667961

Please sign in to comment.