Skip to content

Commit ff0af2c

Browse files
leburgelclaude
authored andcommitted
Compute the sort key of each block once
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent abc00bb commit ff0af2c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎src/spaces/homspace.jl‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,8 @@ function fusionblocks(W::HomSpace)
220220
# which runs fastest over its first space (the sectors of a dual space are sorted by their dual)
221221
key(V, s) = isdual(V) ? dual(s) : s
222222
rank((u₁, u₂)) = (reverse(map(key, domain(W).spaces, u₂)), reverse(map(key, codomain(W).spaces, u₁)))
223-
return map(u -> FusionTreeBlock(groups[u]), sort!(collect(keys(groups)); by = rank))
223+
us = collect(keys(groups))
224+
return map(i -> FusionTreeBlock(groups[us[i]]), sortperm(map(rank, us))) # each rank computed once
224225
end
225226

226227
function diagonalblockstructure(W::HomSpace)

0 commit comments

Comments
 (0)