Skip to content

Commit

Permalink
Merge pull request #25729 from JuliaLang/vc/fixup_bitarray
Browse files Browse the repository at this point in the history
fixup `copyto!(::BitArray, [])`
  • Loading branch information
vchuravy authored Jan 24, 2018
2 parents e0ad15a + 2d6e75c commit 18be1f2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ end

function copyto!(dest::BitArray, src::Array)
length(src) > length(dest) && throw(BoundsError(dest, length(dest)+1))
length(src) == 0 && return det
length(src) == 0 && return dest
return unsafe_copyto!(dest, 1, src, 1, length(src))
end

Expand Down
3 changes: 3 additions & 0 deletions test/bitarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ timesofar("conversions")
end

@testset "copyto!" begin
let b1 = trues(1)
@test all(copyto!(b1, []))
end
for n in [1; 1023:1025]
b1 = falses(n)
for m in [1; 10; 1023:1025]
Expand Down

0 comments on commit 18be1f2

Please sign in to comment.