rewrite/fix deepcopy_internal

This commit is contained in:
Marek Kaluba 2024-02-12 12:33:57 +01:00
parent a33b871754
commit ba6d58ec77
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
1 changed files with 5 additions and 7 deletions

View File

@ -124,13 +124,11 @@ function Base.:(==)(g::AbstractFPGroupElement, h::AbstractFPGroupElement)
end
function Base.deepcopy_internal(g::FPGroupElement, stackdict::IdDict)
haskey(stackdict, objectid(g)) && return stackdict[objectid(g)]
cw = if haskey(stackdict, objectid(word(g)))
stackdict[objectid(word(g))]
else
copy(word(g))
end
return FPGroupElement(cw, parent(g), g.savedhash)
haskey(stackdict, g) && return stackdict[g]
cw = Base.deepcopy_internal(word(g), stackdict)
h = FPGroupElement(cw, parent(g), g.savedhash)
stackdict[g] = h
return h
end
function Base.inv(g::GEl) where {GEl<:AbstractFPGroupElement}