mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-12-12 15:16:27 +01:00
don't compute G.N(p.n) and G.P(g.p) twice when coercing
This commit is contained in:
parent
4fa7d744c2
commit
06a4e50a2d
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user