From 49198dfdf46651722b2b1566e54b1b309f08468e Mon Sep 17 00:00:00 2001 From: kalmarek Date: Wed, 21 Mar 2018 19:21:03 +0100 Subject: [PATCH] use append! and prepend! instead of push! and unshift! This also fixes a bug in l_multiply! --- src/Groups.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Groups.jl b/src/Groups.jl index d324a2b..16c0b6f 100644 --- a/src/Groups.jl +++ b/src/Groups.jl @@ -192,7 +192,7 @@ end function r_multiply!(W::GWord, x; reduced::Bool=true) if length(x) > 0 - push!(W.symbols, x...) + append!(W.symbols, x) end if reduced reduce!(W) @@ -200,9 +200,9 @@ function r_multiply!(W::GWord, x; reduced::Bool=true) return W end -function l_multiply!(W::GWord, x; reduced=true) +function l_multiply!(W::GWord, x; reduced::Bool=true) if length(x) > 0 - unshift!(W.symbols, reverse(x)...) + prepend!(W.symbols, x) end if reduced reduce!(W)