Skip to content

Commit a6c38b2

Browse files
authored
remove unnecessary conversion to Any (#138)
1 parent 7056533 commit a6c38b2

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

src/Operators/banded/Conversion.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ rangespace(C::ConcreteConversion)=C.rangespace
2626

2727

2828

29-
function defaultConversion(a::Space,b::Space)::Any
29+
function defaultConversion(a::Space,b::Space)
3030
if a==b
3131
Conversion(a)
3232
elseif conversion_type(a,b)==NoSpace()

src/Operators/spacepromotion.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ choosedomainspace(A::Operator,_) = choosedomainspace(A)
122122

123123
choosedomainspace(A) = choosedomainspace(A,UnsetSpace())
124124

125-
function choosedomainspace(ops::AbstractVector,spin)::Any
125+
function choosedomainspace(ops::AbstractVector,spin)
126126
sp = UnsetSpace()
127127

128128
for op in ops

src/Space.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ mappoint(a::Domain,b::Space,x)=mappoint(a,domain(b),x)
153153

154154
for FUNC in (:conversion_rule,:maxspace_rule,:union_rule)
155155
@eval begin
156-
function $FUNC(a,b)::Any
156+
function $FUNC(a,b)
157157
if spacescompatible(a,b)
158158
a
159159
else
@@ -175,7 +175,7 @@ end
175175

176176

177177
# gives a space c that has a banded conversion operator TO a and b
178-
function conversion_type(a,b)::Any
178+
function conversion_type(a,b)
179179
if spacescompatible(a,b)
180180
a
181181
elseif !domainscompatible(a,b)
@@ -194,7 +194,7 @@ end
194194

195195
# gives a space c that has a banded conversion operator FROM a and b
196196
maxspace(a,b) = NoSpace() # TODO: this fixes weird bug with Nothing
197-
function maxspace(a::Space, b::Space)::Any
197+
function maxspace(a::Space, b::Space)
198198
if spacescompatible(a,b)
199199
return a
200200
elseif !domainscompatible(a,b)
@@ -254,7 +254,7 @@ union(a::AmbiguousSpace, b::Space) = b
254254
union(a::Space, b::AmbiguousSpace) = a
255255

256256

257-
function union_by_union_rule(a::Space,b::Space)::Any
257+
function union_by_union_rule(a::Space,b::Space)
258258
if spacescompatible(a,b)
259259
if isambiguous(domain(a))
260260
return b
@@ -269,7 +269,7 @@ function union_by_union_rule(a::Space,b::Space)::Any
269269
union_rule(b,a)
270270
end
271271

272-
function union(a::Space, b::Space)::Any
272+
function union(a::Space, b::Space)
273273
cr = union_by_union_rule(a,b)
274274
cr isa NoSpace || return cr
275275

src/Spaces/ProductSpaceOperators.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ export continuity
55

66
for TYP in (:PiecewiseSpace,:ArraySpace)
77
@eval begin
8-
function promotedomainspace(A::InterlaceOperator{T,2},sp::$TYP)::Any where T
8+
function promotedomainspace(A::InterlaceOperator{T,2},sp::$TYP) where T
99
if domainspace(A) == sp
1010
return A
1111
end
1212
@assert size(A.ops,2) == length(sp)
1313
InterlaceOperator([promotedomainspace(A.ops[k,j],sp[j]) for k=1:size(A.ops,1),j=1:size(A.ops,2)],$TYP)
1414
end
15-
function interlace_choosedomainspace(ops,rs::$TYP)::Any
15+
function interlace_choosedomainspace(ops,rs::$TYP)
1616
@assert length(ops) == length(rs)
1717
# this ensures correct dispatch for unino
1818
sps = Array{Space}(
@@ -93,7 +93,7 @@ end
9393

9494
# Sum Space and PiecewiseSpace need to allow permutation of space orders
9595
for TYP in (:SumSpace,:PiecewiseSpace)
96-
@eval function Conversion(S1::$TYP,S2::$TYP)::Any
96+
@eval function Conversion(S1::$TYP,S2::$TYP)
9797
v1 = collect(S1.spaces)
9898
v2 = collect(S2.spaces)
9999

@@ -180,7 +180,7 @@ end
180180
for (OPrule,OP) in ((:conversion_rule,:conversion_type),(:maxspace_rule,:maxspace),
181181
(:union_rule,:union))
182182
for TYP in (:SumSpace,:PiecewiseSpace)
183-
@eval function $OPrule(S1sp::$TYP,S2sp::$TYP)::Any
183+
@eval function $OPrule(S1sp::$TYP,S2sp::$TYP)
184184
S1 = components(S1sp)
185185
S2 = components(S2sp)
186186
cs1,cs2=map(canonicalspace,S1),map(canonicalspace,S2)
@@ -239,7 +239,7 @@ for (Op,OpWrap) in ((:Derivative,:DerivativeWrapper),(:Integral,:IntegralWrapper
239239
end
240240
end
241241

242-
function Derivative(S::SumSpace,k::Integer)::Any
242+
function Derivative(S::SumSpace,k::Integer)
243243
# we want to map before we decompose, as the map may introduce
244244
# mixed bases.
245245
if typeof(canonicaldomain(S))==typeof(domain(S))

src/Spaces/Spaces.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ include("SubSpace.jl")
88
include("QuotientSpace.jl")
99

1010

11-
(A::Space,B::Space)::Any = domainscompatible(A,B) ? SumSpace(A,B) : PiecewiseSpace(A,B)
11+
(A::Space,B::Space) = domainscompatible(A,B) ? SumSpace(A,B) : PiecewiseSpace(A,B)
1212
(f::Fun,g::Fun) = Fun(space(f) space(g), interlace(coefficients(f),coefficients(g)))
1313

1414
(f::Fun,g::Fun,h::Fun...) = ((f g), h...)

src/Spaces/SumSpace.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ end
182182

183183

184184
# avoids default ConstantSpace
185-
function union_rule(B::ConstantSpace,A::SumSpace)::Any
185+
function union_rule(B::ConstantSpace,A::SumSpace)
186186
if !domainscompatible(A,B)
187187
NoSpace()
188188
else
@@ -195,7 +195,7 @@ function union_rule(B::ConstantSpace,A::SumSpace)::Any
195195
end
196196
end
197197

198-
function union_rule(A::SumSpace, B::Space)::Any
198+
function union_rule(A::SumSpace, B::Space)
199199
if !domainscompatible(A,B)
200200
NoSpace()
201201
else

0 commit comments

Comments
 (0)