Skip to content

Commit bc51c6d

Browse files
authored
mapreduce to map+reduce for tuples (#359)
1 parent e7926e6 commit bc51c6d

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ApproxFunBase"
22
uuid = "fbd15aa5-315a-5a7d-a8a4-24992e37be05"
3-
version = "0.7.63"
3+
version = "0.7.64"
44

55
[deps]
66
AbstractFFTs = "621f4979-c628-5d54-868e-fcf4e3e8185c"

src/Spaces/SumSpace.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ interlacer(sp::Space) = BlockInterlacer(tuple(blocklengths(sp)))
2929

3030
function blocklengths(sp::DirectSumSpace)
3131
bl=map(blocklengths,components(sp))
32-
N=mapreduce(length,max,bl)
32+
N = maximum(map(length, bl))
3333
mapreduce(b->pad(b,N),+,bl)
3434
end
3535
block(sp::DirectSumSpace,k::Int) =
@@ -413,7 +413,7 @@ function Fun(v::Tuple,::Type{PiecewiseSpace})
413413
Fun(sp,interlace(v,sp))
414414
end
415415

416-
Fun(v::AbstractVector{Any},::Type{PiecewiseSpace}) = Fun(tuple(v...),PiecewiseSpace)
416+
Fun(v::AbstractVector{Any},::Type{PiecewiseSpace}) = Fun(Tuple(v),PiecewiseSpace)
417417

418418
## transforms
419419
points(d::PiecewiseSpace,n) = vcat(points.(pieces(d), pieces_npoints(d,n))...)
@@ -485,7 +485,7 @@ end
485485

486486
## Multivariate
487487

488-
ncomponents(sp::TensorSpace) = mapreduce(s -> ncomponents(s), *, factors(sp))
488+
ncomponents(sp::TensorSpace) = mapreduce(ncomponents, *, factors(sp))
489489

490490
component(sp::TensorSpace{Tuple{S1,S2}},k::Integer) where {S1<:DirectSumSpace,S2<:DirectSumSpace} =
491491
error("Not defined. Used component(sp,k,j).")

0 commit comments

Comments
 (0)