From c880b51346b18d9d0fbf3c48f09779fb3ce7cc3a Mon Sep 17 00:00:00 2001 From: kalmarek Date: Thu, 29 Mar 2018 19:37:32 +0200 Subject: [PATCH] remove isone(::GSymbol) --- src/FreeGroup.jl | 5 +++-- src/Groups.jl | 6 +----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/FreeGroup.jl b/src/FreeGroup.jl index 6624f2b..64d9b28 100644 --- a/src/FreeGroup.jl +++ b/src/FreeGroup.jl @@ -102,9 +102,10 @@ end ############################################################################### function (==)(s::FreeSymbol, t::FreeSymbol) - isone(s) && isone(t) && return true - s.str == t.str || return false s.pow == t.pow || return false + s.pow == 0 && return true + s.str == t.str || return false + return true end diff --git a/src/Groups.jl b/src/Groups.jl index c8e663d..fe117ea 100644 --- a/src/Groups.jl +++ b/src/Groups.jl @@ -103,8 +103,6 @@ function deepcopy_internal(W::T, dict::ObjectIdDict) where {T<:GWord} return G(T(deepcopy(W.symbols))) end -isone(s::GSymbol) = s.pow == 0 - length(W::GWord) = sum([length(s) for s in W.symbols]) function delete_ids!(W::GWord) @@ -189,9 +187,7 @@ function show(io::IO, W::GWord) end function show(io::IO, s::T) where {T<:GSymbol} - if isone(s) - print(io, "(id)") - elseif s.pow == 1 + if s.pow == 1 print(io, s.str) else print(io, (s.str)*"^$(s.pow)")