Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misc changes to where syntax plus other clean ups #21487

Merged
merged 3 commits into from
Apr 23, 2017
Merged

Conversation

musm
Copy link
Contributor

@musm musm commented Apr 22, 2017

No description provided.

@@ -60,7 +60,7 @@ end
# Performance optimization: get rid of a branch on `d` in `indices(A,
# d)` for d=1. 1d arrays are heavily used, and the first dimension
# comes up in other applications.
indices1{T}(A::AbstractArray{T,0}) = OneTo(1)
indices1(A::AbstractArray{T,0}) where {T} = OneTo(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this is not using T, this could be indices1(A::AbstractArray{<:Any,0}) = OneTo(1)

@@ -148,7 +148,7 @@ end
SharedArray{T,3}(m, n, o; kwargs...)

function (::Type{SharedArray{T,N}})(filename::AbstractString, dims::NTuple{N,Int},
offset::Integer=0; mode=nothing, init=false, pids::Vector{Int}=Int[]) where T where N
offset::Integer=0; mode=nothing, init=false, pids::Vector{Int}=Int[]) where T where N
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where {T,N}?

@@ -340,7 +340,7 @@ function checkbounds(::Type{Bool}, A::AbstractArray, i)
checkindex(Bool, linearindices(A), i)
end
# As a special extension, allow using logical arrays that match the source array exactly
function checkbounds{_,N}(::Type{Bool}, A::AbstractArray{_,N}, I::AbstractArray{Bool,N})
function checkbounds(::Type{Bool}, A::AbstractArray{_,N}, I::AbstractArray{Bool,N}) where {_,N}
Copy link
Contributor Author

@musm musm Apr 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this be better as
function checkbounds(::Type{Bool}, A::AbstractArray{<:Any,N}, I::AbstractArray{Bool,N}) where N
or are those different? @pabloferz

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are the same and I like the <:Any better that the _ so if you feel like changing it, go for it!

@@ -148,7 +148,7 @@ end
SharedArray{T,3}(m, n, o; kwargs...)

function (::Type{SharedArray{T,N}})(filename::AbstractString, dims::NTuple{N,Int},
offset::Integer=0; mode=nothing, init=false, pids::Vector{Int}=Int[]) where T where N
offset::Integer=0; mode=nothing, init=false, pids::Vector{Int}=Int[]) where {T,N}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe move offset to the previous line

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@musm
Copy link
Contributor Author

musm commented Apr 22, 2017

this will need a squash

@tkelman tkelman merged commit 02d7b14 into JuliaLang:master Apr 23, 2017
@musm musm deleted the mfs branch April 23, 2017 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants