try...catch are slow

This commit is contained in:
kalmar 2017-07-16 21:44:42 +02:00
parent a66d7755ae
commit 8daa86df31
1 changed files with 1 additions and 5 deletions

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