From 17958fbd2c2c15b04250373ecca867036b3579af Mon Sep 17 00:00:00 2001 From: kalmarek Date: Tue, 27 Mar 2018 21:48:36 +0200 Subject: [PATCH] accomodate to abstract GWord{T} --- src/Groups.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Groups.jl b/src/Groups.jl index 858b75f..af0d1bc 100644 --- a/src/Groups.jl +++ b/src/Groups.jl @@ -356,7 +356,7 @@ function replace(W::GWord, index, toreplace::GWord, replacement::GWord) replace!(deepcopy(W), index, toreplace, replacement) end -function replace_all!(W::GWord{T},subst_dict::Dict{GWord{T},GWord{T}}) where {T} +function replace_all!(W::T,subst_dict::Dict{T,T}) where {T<:GWord} modified = false for toreplace in reverse!(sort!(collect(keys(subst_dict)), by=length)) replacement = subst_dict[toreplace] @@ -370,7 +370,7 @@ function replace_all!(W::GWord{T},subst_dict::Dict{GWord{T},GWord{T}}) where {T} return modified end -function replace_all(W::GWord{T},subst_dict::Dict{GWord{T},GWord{T}}) where {T} +function replace_all(W::T, subst_dict::Dict{T,T}) where {T<:GWord} W = deepcopy(W) replace_all!(W, subst_dict) return W