From 715ddd4e291e36a733af82a139ad8995f9e236cc Mon Sep 17 00:00:00 2001 From: Pablo Zubieta Date: Thu, 29 Dec 2016 22:38:00 -0600 Subject: [PATCH] Deprecate `bitbroadcast` --- base/broadcast.jl | 21 +-------------------- base/deprecated.jl | 3 +++ test/bitarray.jl | 4 ++-- 3 files changed, 6 insertions(+), 22 deletions(-) diff --git a/base/broadcast.jl b/base/broadcast.jl index a5163e3cd181bc..fc74a30c3b1c91 100644 --- a/base/broadcast.jl +++ b/base/broadcast.jl @@ -7,8 +7,7 @@ using Base: promote_eltype_op, linearindices, tail, OneTo, to_shape, _msk_end, unsafe_bitgetindex, bitcache_chunks, bitcache_size, dumpbitcache, nullable_returntype, null_safe_eltype_op, hasvalue, is_nullable_array import Base: broadcast, broadcast! -export bitbroadcast, dotview -export broadcast_getindex, broadcast_setindex! +export broadcast_getindex, broadcast_setindex!, dotview ## Broadcasting utilities ## @@ -464,24 +463,6 @@ julia> Ref(7) .+ Nullable(3) """ @inline broadcast(f, A, Bs...) = broadcast_c(f, containertype(A, Bs...), A, Bs...) -""" - bitbroadcast(f, As...) - -Like [`broadcast`](@ref), but allocates a `BitArray` to store the -result, rather then an `Array`. - -```jldoctest -julia> bitbroadcast(isodd,[1,2,3,4,5]) -5-element BitArray{1}: - true - false - true - false - true -``` -""" -@inline bitbroadcast(f, As...) = broadcast!(f, similar(BitArray, broadcast_indices(As...)), As...) - """ broadcast_getindex(A, inds...) diff --git a/base/deprecated.jl b/base/deprecated.jl index 35da70e7a5a413..5ff963384b028e 100644 --- a/base/deprecated.jl +++ b/base/deprecated.jl @@ -1224,4 +1224,7 @@ function quadgk(args...) end export quadgk +# Broadcast now returns a BitArray when the resulting eltype is Bool (#17623) +@deprecate bitbroadcast(f, As...) broadcast(f, As...) + # End deprecations scheduled for 0.6 diff --git a/test/bitarray.jl b/test/bitarray.jl index 68e75746c3c263..ae2f5980ac2239 100644 --- a/test/bitarray.jl +++ b/test/bitarray.jl @@ -1138,8 +1138,8 @@ let b1 = trues(v1), b2 = falses(v1) end end -let odds = bitbroadcast(isodd, 1:2000) - evens = bitbroadcast(iseven, 1:2000) +let odds = broadcast(isodd, 1:2000) + evens = broadcast(iseven, 1:2000) for i = 1:2:2000 @test findprev(odds,i) == findprevnot(evens,i) == i @test findnext(odds,i) == findnextnot(evens,i) == i