1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-12-26 02:20: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) function (G::WreathProduct{N})(g::WreathProductElem{N}) where {N}
n = try n = G.N(g.n)
G.N(g.n) p = G.P(g.p)
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
return WreathProductElem(n, p) return WreathProductElem(n, p)
end end