From 06a4e50a2d7fc83fe0e7067d4cdebe784ffff112 Mon Sep 17 00:00:00 2001 From: kalmar Date: Fri, 21 Jul 2017 13:37:28 +0200 Subject: [PATCH] don't compute G.N(p.n) and G.P(g.p) twice when coercing --- src/WreathProducts.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/WreathProducts.jl b/src/WreathProducts.jl index 12816d9..3d086a3 100644 --- a/src/WreathProducts.jl +++ b/src/WreathProducts.jl @@ -68,18 +68,18 @@ parent(g::WreathProductElem) = WreathProduct(parent(g.n[1]), parent(g.p)) ############################################################################### function (G::WreathProduct)(g::WreathProductElem) - try + n = try G.N(g.n) catch throw("Can't coerce $(g.n) to $(G.N) factor of $G") end - try + p = try G.P(g.p) catch throw("Can't coerce $(g.p) to $(G.P) factor of $G") end - elt = WreathProductElem(G.N(g.n), G.P(g.p)) - elt.parent = G + elt = WreathProductElem(n, p) + # elt.parent = G return elt end