Skip to content

Commit ecbdaa6

Browse files
committed
Avoid using one(I)
1 parent 9311fb0 commit ecbdaa6

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/fusiontrees/fusiontreeblocks.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,16 @@ function FusionTreeBlock{I}(uncoupled::Tuple{NTuple{N₁,I},NTuple{N₂,I}},
99
F₂ = fusiontreetype(I, N₂)
1010
trees = Vector{Tuple{F₁,F₂}}(undef, 0)
1111

12-
cleft = N₁ == 0 ? (one(I),) : (uncoupled[1]...)
13-
cright = N₂ == 0 ? (one(I),) : (uncoupled[2]...)
14-
cs = sort!(collect(intersect(cleft, cright)))
12+
if N₁ == N₂ == 0
13+
return FusionTreeBlock(trees)
14+
elseif N₁ == 0
15+
cs = sort!(collect(filter(isone, (uncoupled[2]...))))
16+
elseif N₂ == 0
17+
cs = sort!(collect(filter(isone, (uncoupled[1]...))))
18+
else
19+
cs = sort!(collect(intersect((uncoupled[1]...), (uncoupled[2]...))))
20+
end
21+
1522
for c in cs
1623
for f₁ in fusiontrees(uncoupled[1], c, isdual[1]),
1724
f₂ in fusiontrees(uncoupled[2], c, isdual[2])

0 commit comments

Comments
 (0)