Skip to content

Commit c03f255

Browse files
committed
Address review comments
1 parent acf19c9 commit c03f255

File tree

13 files changed

+34
-37
lines changed

13 files changed

+34
-37
lines changed

base/dates/types.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,9 +294,9 @@ Base.typemin(::Union{Date, Type{Date}}) = Date(-252522163911150, 1, 1)
294294
Base.typemax(::Union{Time, Type{Time}}) = Time(23, 59, 59, 999, 999, 999)
295295
Base.typemin(::Union{Time, Type{Time}}) = Time(0)
296296
# Date-DateTime promotion, isless, ==
297-
Base.eltype{T<:Period}(::Type{T}) = T
297+
Base.eltype(::Type{T}) where {T<:Period} = T
298298
Base.promote_rule(::Type{Date}, x::Type{DateTime}) = DateTime
299-
Base.isless{T<:TimeType}(x::T, y::T) = isless(value(x), value(y))
299+
Base.isless(x::T, y::T) where {T<:TimeType} = isless(value(x), value(y))
300300
Base.isless(x::TimeType, y::TimeType) = isless(Base.promote_noncircular(x, y)...)
301301
==(x::T, y::T) where {T<:TimeType} = ==(value(x), value(y))
302302
function ==(a::Time, b::Time)

base/docs/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ print(io::IO, t::Text) = print(io, t.content)
7272
print(io::IO, t::Text{<:Function}) = t.content(io)
7373
show(io::IO, t::Text) = print(io, t)
7474

75-
==(t1::T, t2::T) where {T<:Union{HTML, Text}} = t1.content == t2.content
76-
hash{T<:Union{HTML, Text}}(t::T, h::UInt) = hash(T, hash(t.content, h))
75+
==(t1::T, t2::T) where {T<:Union{HTML,Text}} = t1.content == t2.content
76+
hash(t::T, h::UInt) where {T<:Union{HTML,Text}} = hash(T, hash(t.content, h))
7777

7878
"""
7979
@text_str -> Docs.Text

base/essentials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ function typename(a::Union)
133133
end
134134
typename(union::UnionAll) = typename(union.body)
135135

136-
convert(::Type{T}, x::Tuple{Any, Vararg{Any}}) where {T<:Tuple{Any,Vararg{Any}}} =
136+
convert(::Type{T}, x::Tuple{Any,Vararg{Any}}) where {T<:Tuple{Any,Vararg{Any}}} =
137137
tuple(convert(tuple_type_head(T),x[1]), convert(tuple_type_tail(T), tail(x))...)
138138
convert(::Type{T}, x::T) where {T<:Tuple{Any,Vararg{Any}}} = x
139139

base/int.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const BitUnsigned64T = Union{Type{UInt8}, Type{UInt16}, Type{UInt32}, Type{UInt6
2727

2828
(<)(x::T, y::T) where {T<:BitSigned} = slt_int(x, y)
2929

30-
(-)(x::BitInteger) = neg_int(x)
30+
(-)(x::BitInteger) = neg_int(x)
3131
(-)(x::T, y::T) where {T<:BitInteger} = sub_int(x, y)
3232
(+)(x::T, y::T) where {T<:BitInteger} = add_int(x, y)
3333
(*)(x::T, y::T) where {T<:BitInteger} = mul_int(x, y)

base/linalg/bidiag.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ end
199199
convert(::Type{Matrix}, A::Bidiagonal{T}) where {T} = convert(Matrix{T}, A)
200200
convert(::Type{Array}, A::Bidiagonal) = convert(Matrix, A)
201201
full(A::Bidiagonal) = convert(Array, A)
202-
promote_rule(::Type{Matrix{T}}, ::Type{Bidiagonal{S}}) where {T,S}=Matrix{promote_type(T,S)}
202+
promote_rule(::Type{Matrix{T}}, ::Type{Bidiagonal{S}}) where {T,S} = Matrix{promote_type(T,S)}
203203

204204
#Converting from Bidiagonal to Tridiagonal
205205
Tridiagonal(M::Bidiagonal{T}) where {T} = convert(Tridiagonal{T}, M)
@@ -327,15 +327,15 @@ function diag{T}(M::Bidiagonal{T}, n::Integer=0)
327327
end
328328

329329
function +(A::Bidiagonal, B::Bidiagonal)
330-
if A.isupper==B.isupper
330+
if A.isupper == B.isupper
331331
Bidiagonal(A.dv+B.dv, A.ev+B.ev, A.isupper)
332332
else
333333
Tridiagonal((A.isupper ? (B.ev,A.dv+B.dv,A.ev) : (A.ev,A.dv+B.dv,B.ev))...)
334334
end
335335
end
336336

337337
function -(A::Bidiagonal, B::Bidiagonal)
338-
if A.isupper==B.isupper
338+
if A.isupper == B.isupper
339339
Bidiagonal(A.dv-B.dv, A.ev-B.ev, A.isupper)
340340
else
341341
Tridiagonal((A.isupper ? (-B.ev,A.dv-B.dv,A.ev) : (A.ev,A.dv-B.dv,-B.ev))...)

base/linalg/lq.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ end
137137

138138
## Multiplication by Q
139139
### QB
140-
A_mul_B!(A::LQPackedQ{T}, B::StridedVecOrMat{T}) where {T<:BlasFloat} = LAPACK.ormlq!('L','N',A.factors,A.τ,B)
140+
A_mul_B!(A::LQPackedQ{T}, B::StridedVecOrMat{T}) where {T<:BlasFloat} = LAPACK.ormlq!('L','N',A.factors,A.τ,B)
141141
function (*)(A::LQPackedQ,B::StridedVecOrMat)
142142
TAB = promote_type(eltype(A), eltype(B))
143143
A_mul_B!(convert(AbstractMatrix{TAB}, A), copy_oftype(B, TAB))
144144
end
145145

146146
### QcB
147-
Ac_mul_B!(A::LQPackedQ{T}, B::StridedVecOrMat{T}) where {T<:BlasReal} = LAPACK.ormlq!('L','T',A.factors,A.τ,B)
147+
Ac_mul_B!(A::LQPackedQ{T}, B::StridedVecOrMat{T}) where {T<:BlasReal} = LAPACK.ormlq!('L','T',A.factors,A.τ,B)
148148
Ac_mul_B!(A::LQPackedQ{T}, B::StridedVecOrMat{T}) where {T<:BlasComplex} = LAPACK.ormlq!('L','C',A.factors,A.τ,B)
149149
function Ac_mul_B(A::LQPackedQ, B::StridedVecOrMat)
150150
TAB = promote_type(eltype(A), eltype(B))

base/linalg/matmul.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ end
4343
vecdot(x::Union{DenseArray{T},StridedVector{T}}, y::Union{DenseArray{T},StridedVector{T}}) where {T<:BlasReal} = BLAS.dot(x, y)
4444
vecdot(x::Union{DenseArray{T},StridedVector{T}}, y::Union{DenseArray{T},StridedVector{T}}) where {T<:BlasComplex} = BLAS.dotc(x, y)
4545

46-
function dot(x::Vector{T}, rx::Union{UnitRange{TI},Range{TI}}, y::Vector{T}, ry::Union{UnitRange{TI},Range{TI}}) where {T<:BlasReal, TI<:Integer}
46+
function dot(x::Vector{T}, rx::Union{UnitRange{TI},Range{TI}}, y::Vector{T}, ry::Union{UnitRange{TI},Range{TI}}) where {T<:BlasReal,TI<:Integer}
4747
if length(rx) != length(ry)
4848
throw(DimensionMismatch("length of rx, $(length(rx)), does not equal length of ry, $(length(ry))"))
4949
end
@@ -56,7 +56,7 @@ function dot(x::Vector{T}, rx::Union{UnitRange{TI},Range{TI}}, y::Vector{T}, ry:
5656
BLAS.dot(length(rx), pointer(x)+(first(rx)-1)*sizeof(T), step(rx), pointer(y)+(first(ry)-1)*sizeof(T), step(ry))
5757
end
5858

59-
function dot(x::Vector{T}, rx::Union{UnitRange{TI},Range{TI}}, y::Vector{T}, ry::Union{UnitRange{TI},Range{TI}}) where {T<:BlasComplex, TI<:Integer}
59+
function dot(x::Vector{T}, rx::Union{UnitRange{TI},Range{TI}}, y::Vector{T}, ry::Union{UnitRange{TI},Range{TI}}) where {T<:BlasComplex,TI<:Integer}
6060
if length(rx) != length(ry)
6161
throw(DimensionMismatch("length of rx, $(length(rx)), does not equal length of ry, $(length(ry))"))
6262
end
@@ -329,8 +329,8 @@ function herk_wrapper!(C::Union{StridedMatrix{T}, StridedMatrix{Complex{T}}}, tA
329329
end
330330

331331
function gemm_wrapper(tA::Char, tB::Char,
332-
A::StridedVecOrMat{T},
333-
B::StridedVecOrMat{T}) where T<:BlasFloat
332+
A::StridedVecOrMat{T},
333+
B::StridedVecOrMat{T}) where T<:BlasFloat
334334
mA, nA = lapack_size(tA, A)
335335
mB, nB = lapack_size(tB, B)
336336
C = similar(B, T, mA, nB)

base/linalg/triangular.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ function -(A::UnitUpperTriangular)
324324
end
325325

326326
# copy and scale
327-
function copy!(A::T, B::T) where T<:Union{UpperTriangular, UnitUpperTriangular}
327+
function copy!(A::T, B::T) where T<:Union{UpperTriangular,UnitUpperTriangular}
328328
n = size(B,1)
329329
for j = 1:n
330330
for i = 1:(isa(B, UnitUpperTriangular)?j-1:j)
@@ -333,7 +333,7 @@ function copy!(A::T, B::T) where T<:Union{UpperTriangular, UnitUpperTriangular}
333333
end
334334
return A
335335
end
336-
function copy!(A::T, B::T) where T<:Union{LowerTriangular, UnitLowerTriangular}
336+
function copy!(A::T, B::T) where T<:Union{LowerTriangular,UnitLowerTriangular}
337337
n = size(B,1)
338338
for j = 1:n
339339
for i = (isa(B, UnitLowerTriangular)?j+1:j):n
@@ -343,7 +343,7 @@ function copy!(A::T, B::T) where T<:Union{LowerTriangular, UnitLowerTriangular}
343343
return A
344344
end
345345

346-
function scale!(A::UpperTriangular, B::Union{UpperTriangular, UnitUpperTriangular}, c::Number)
346+
function scale!(A::UpperTriangular, B::Union{UpperTriangular,UnitUpperTriangular}, c::Number)
347347
n = checksquare(B)
348348
for j = 1:n
349349
if isa(B, UnitUpperTriangular)
@@ -355,7 +355,7 @@ function scale!(A::UpperTriangular, B::Union{UpperTriangular, UnitUpperTriangula
355355
end
356356
return A
357357
end
358-
function scale!(A::LowerTriangular, B::Union{LowerTriangular, UnitLowerTriangular}, c::Number)
358+
function scale!(A::LowerTriangular, B::Union{LowerTriangular,UnitLowerTriangular}, c::Number)
359359
n = checksquare(B)
360360
for j = 1:n
361361
if isa(B, UnitLowerTriangular)

base/markdown/render/html.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ end
3939
function htmlesc(io::IO, s::Symbol)
4040
htmlesc(io, string(s))
4141
end
42-
function htmlesc(io::IO, xs::Union{AbstractString, Symbol}...)
42+
function htmlesc(io::IO, xs::Union{AbstractString,Symbol}...)
4343
for s in xs
4444
htmlesc(io, s)
4545
end
4646
end
47-
function htmlesc(s::Union{AbstractString, Symbol})
47+
function htmlesc(s::Union{AbstractString,Symbol})
4848
sprint(htmlesc, s)
4949
end
5050

@@ -139,7 +139,7 @@ function htmlinline(io::IO, code::Code)
139139
end
140140
end
141141

142-
function htmlinline(io::IO, md::Union{Symbol, AbstractString})
142+
function htmlinline(io::IO, md::Union{Symbol,AbstractString})
143143
htmlesc(io, md)
144144
end
145145

base/pair.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ first(p::Pair) = p.first
3131
last(p::Pair) = p.second
3232

3333
convert(::Type{Pair{A,B}}, x::Pair{A,B}) where {A,B} = x
34-
function convert(::Type{Pair{A,B}}, x::Pair) where A where B
35-
Pair{A, B}(convert(A, x[1]), convert(B, x[2]))
34+
function convert(::Type{Pair{A,B}}, x::Pair) where {A,B}
35+
Pair{A,B}(convert(A, x[1]), convert(B, x[2]))
3636
end
3737

38-
promote_rule(::Type{Pair{A1, B1}}, ::Type{Pair{A2, B2}}) where {A1, B1, A2, B2} =
38+
promote_rule(::Type{Pair{A1,B1}}, ::Type{Pair{A2,B2}}) where {A1,B1,A2,B2} =
3939
Pair{promote_type(A1, A2), promote_type(B1, B2)}

base/promotion.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ end
202202
# promote numeric types T and S to typejoin(T,S) if T<:S or S<:T
203203
# for example this makes promote_type(Integer,Real) == Real without
204204
# promoting arbitrary pairs of numeric types to Number.
205-
promote_to_supertype(::Type{T}, ::Type{T}, ::Type{T}) where {T<:Number } = (@_pure_meta; T)
205+
promote_to_supertype(::Type{T}, ::Type{T}, ::Type{T}) where {T<:Number} = (@_pure_meta; T)
206206
promote_to_supertype(::Type{T}, ::Type{S}, ::Type{T}) where {T<:Number,S<:Number} = (@_pure_meta; T)
207207
promote_to_supertype(::Type{T}, ::Type{S}, ::Type{S}) where {T<:Number,S<:Number} = (@_pure_meta; S)
208208
promote_to_supertype(::Type{T}, ::Type{S}, ::Type) where {T<:Number,S<:Number} =

base/sparse/sparsevector.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ function setindex!(x::SparseVector{Tv,Ti}, v::Tv, i::Ti) where {Tv,Ti<:Integer}
243243
x
244244
end
245245

246-
setindex!(x::SparseVector{Tv,Ti}, v, i::Integer) where {Tv, Ti<:Integer} =
246+
setindex!(x::SparseVector{Tv,Ti}, v, i::Integer) where {Tv,Ti<:Integer} =
247247
setindex!(x, convert(Tv, v), convert(Ti, i))
248248

249249

@@ -415,7 +415,7 @@ function copy!(A::SparseVector, B::SparseMatrixCSC)
415415
return A
416416
end
417417

418-
copy!(A::SparseMatrixCSC, B::SparseVector{TvB,TiB}) where {TvB, TiB} =
418+
copy!(A::SparseMatrixCSC, B::SparseVector{TvB,TiB}) where {TvB,TiB} =
419419
copy!(A, SparseMatrixCSC{TvB,TiB}(B.n, 1, TiB[1, length(B.nzind)+1], B.nzind, B.nzval))
420420

421421

base/test.jl

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,10 +1105,8 @@ end
11051105
#
11061106
# Raises an error if any columnwise vector norm exceeds err. Otherwise, returns
11071107
# nothing.
1108-
function test_approx_eq_modphase(
1109-
a::StridedVecOrMat{S}, b::StridedVecOrMat{T},
1110-
err = length(indices(a,1))^3*(eps(S)+eps(T))
1111-
) where {S<:Real,T<:Real}
1108+
function test_approx_eq_modphase(a::StridedVecOrMat{S}, b::StridedVecOrMat{T},
1109+
err = length(indices(a,1))^3*(eps(S)+eps(T))) where {S<:Real,T<:Real}
11121110
@test indices(a,1) == indices(b,1) && indices(a,2) == indices(b,2)
11131111
for i in indices(a,2)
11141112
v1, v2 = a[:, i], b[:, i]
@@ -1129,11 +1127,10 @@ elsewhere.
11291127
want to set this to `false`. See [`Base.isambiguous`](@ref).
11301128
"""
11311129
function detect_ambiguities(mods...;
1132-
imported::Bool = false,
1133-
ambiguous_bottom::Bool = false,
1134-
allow_bottom::Union{Bool,Void} = nothing
1135-
)
1136-
if allow_bottom != nothing
1130+
imported::Bool = false,
1131+
ambiguous_bottom::Bool = false,
1132+
allow_bottom::Union{Bool,Void} = nothing)
1133+
if allow_bottom !== nothing
11371134
Base.depwarn("the `allow_bottom` keyword to detect_ambiguities has been renamed to `ambiguous_bottom`", :detect_ambiguities)
11381135
ambiguous_bottom = allow_bottom
11391136
end

0 commit comments

Comments
 (0)