1
0
mirror of https://github.com/kalmarek/GroupRings.jl.git synced 2024-12-29 11:00:28 +01:00

try...catch are slow

This commit is contained in:
kalmar 2017-07-16 21:44:42 +02:00
parent a66d7755ae
commit 8daa86df31

View File

@ -128,11 +128,7 @@ function (RG::GroupRing)(T::Type=Int)
end
function (RG::GroupRing)(g::GroupElem, T::Type=Int)
g = try
RG.group(g)
catch
throw("Can't coerce $g to the underlying group of $RG")
end
g = RG.group(g)
result = RG(T)
result[g] = one(T)
return result