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

don't use try-catch in constructing WreatProductElements

This commit is contained in:
kalmarek 2019-01-02 15:48:38 +01:00
parent 74a559a17b
commit 4dcc9121a0

View File

@ -63,17 +63,9 @@ parent(g::WreathProductElem) = WreathProduct(parent(g.n[1]), parent(g.p))
#
###############################################################################
function (G::WreathProduct)(g::WreathProductElem)
n = try
G.N(g.n)
catch
throw(DomainError("Can't coerce $(g.n) to $(G.N) factor of $G"))
end
p = try
G.P(g.p)
catch
throw(DomainError("Can't coerce $(g.p) to $(G.P) factor of $G"))
end
function (G::WreathProduct{N})(g::WreathProductElem{N}) where {N}
n = G.N(g.n)
p = G.P(g.p)
return WreathProductElem(n, p)
end