make wl_ball thread safe: pre-compute normalforms!

This commit is contained in:
Marek Kaluba 2022-11-15 19:52:40 +01:00
parent 22c21706d8
commit 9006f8a4a1
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
1 changed files with 2 additions and 1 deletions

View File

@ -34,7 +34,8 @@ function _wlmetric_ball(S, old, radius, op, collect, unique)
for r in 2:radius
old = let old = old, S = S,
new = collect(
(g = op(o, s); hash(g); g)
(g = op(o, s); normalform!(g); hash(g); g)
# normalform! and hash are to make assure thread-safety of produced elts
for o in @view(old[sizes[end-1]:end]) for s in S
)