1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-11-04 02:50:28 +01:00

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

View File

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