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:
parent
a66d7755ae
commit
8daa86df31
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user