From 9006f8a4a1b583175a2fb420865a1f653beeaec0 Mon Sep 17 00:00:00 2001 From: Marek Kaluba Date: Tue, 15 Nov 2022 19:52:40 +0100 Subject: [PATCH] make wl_ball thread safe: pre-compute normalforms! --- src/wl_ball.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/wl_ball.jl b/src/wl_ball.jl index 18645cb..0c52080 100644 --- a/src/wl_ball.jl +++ b/src/wl_ball.jl @@ -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 )