Skip to content

Commit

Permalink
Merge pull request #11678 from JuliaLang/revert-10331-mb/colon-indexing
Browse files Browse the repository at this point in the history
Move setindex! with Colon from array.jl to arraymath.jl
  • Loading branch information
tkelman committed Jun 12, 2015
2 parents f5f4ea0 + 08b33b3 commit 064e96b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 15 deletions.
14 changes: 0 additions & 14 deletions base/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -343,20 +343,6 @@ function setindex!(A::Array, X::AbstractArray, I::AbstractVector{Int})
end
return A
end
function setindex!(A::Array, x, ::Colon)
for i in 1:length(A)
@inbounds A[i] = x
end
return A
end
function setindex!(A::Array, X::AbstractArray, ::Colon)
setindex_shape_check(X, length(A))
i = 0
for x in X
@inbounds A[i+=1] = x
end
return A
end

# Faster contiguous setindex! with copy!
setindex!{T}(A::Array{T}, X::Array{T}, I::UnitRange{Int}) = (checkbounds(A, I); unsafe_setindex!(A, X, I))
Expand Down
2 changes: 1 addition & 1 deletion base/intset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ symdiff(s1::IntSet, s2::IntSet) =
(s1.limit >= s2.limit ? symdiff!(copy(s1), s2) : symdiff!(copy(s2), s1))

function empty!(s::IntSet)
s.bits[:] = 0
fill!(s.bits, 0)
return s
end

Expand Down

0 comments on commit 064e96b

Please sign in to comment.