Skip to content

Commit

Permalink
where syntax: add few curly braces for short form functions (#22243)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfourquet authored and ararslan committed Jun 6, 2017
1 parent 91f08bb commit 97195d6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions base/dict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ copy(d::Dict) = Dict(d)

const AnyDict = Dict{Any,Any}

Dict(ps::Pair{K,V}...) where {K,V} = Dict{K,V}(ps)
Dict(ps::Pair{K}...,) where K = Dict{K,Any}(ps)
Dict(ps::(Pair{K,V} where K)...,) where V = Dict{Any,V}(ps)
Dict(ps::Pair...) = Dict{Any,Any}(ps)
Dict(ps::Pair{K,V}...) where {K,V} = Dict{K,V}(ps)
Dict(ps::Pair{K}...) where {K} = Dict{K,Any}(ps)
Dict(ps::(Pair{K,V} where K)...) where {V} = Dict{Any,V}(ps)
Dict(ps::Pair...) = Dict{Any,Any}(ps)

function Dict(kv)
try
Expand Down
2 changes: 1 addition & 1 deletion base/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ will always be called.
function securezero! end
@noinline securezero!(a::AbstractArray{<:Number}) = fill!(a, 0)
securezero!(s::String) = unsafe_securezero!(pointer(s), sizeof(s))
@noinline unsafe_securezero!(p::Ptr{T}, len::Integer=1) where T =
@noinline unsafe_securezero!(p::Ptr{T}, len::Integer=1) where {T} =
ccall(:memset, Ptr{T}, (Ptr{T}, Cint, Csize_t), p, 0, len*sizeof(T))
unsafe_securezero!(p::Ptr{Void}, len::Integer=1) = Ptr{Void}(unsafe_securezero!(Ptr{UInt8}(p), len))

Expand Down
4 changes: 2 additions & 2 deletions base/weakkeydict.jl
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ WeakKeyDict(kv::Tuple{}) = WeakKeyDict()
copy(d::WeakKeyDict) = WeakKeyDict(d)

WeakKeyDict(ps::Pair{K,V}...) where {K,V} = WeakKeyDict{K,V}(ps)
WeakKeyDict(ps::Pair{K}...) where {K } = WeakKeyDict{K,Any}(ps)
WeakKeyDict(ps::(Pair{K,V} where K)...) where {V } = WeakKeyDict{Any,V}(ps)
WeakKeyDict(ps::Pair{K}...) where {K} = WeakKeyDict{K,Any}(ps)
WeakKeyDict(ps::(Pair{K,V} where K)...) where {V} = WeakKeyDict{Any,V}(ps)
WeakKeyDict(ps::Pair...) = WeakKeyDict{Any,Any}(ps)

function WeakKeyDict(kv)
Expand Down

0 comments on commit 97195d6

Please sign in to comment.