1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-11-19 06:30:29 +01:00

use append! and prepend! instead of push! and unshift!

This also fixes a bug in l_multiply!
This commit is contained in:
kalmarek 2018-03-21 19:21:03 +01:00
parent 181073b517
commit 49198dfdf4

View File

@ -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)