1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-07-12 01:35:30 +02:00

don't compute G.N(p.n) and G.P(g.p) twice when coercing

This commit is contained in:
kalmar 2017-07-21 13:37:28 +02:00
parent 4fa7d744c2
commit 06a4e50a2d

View File

@ -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