tocanonicalD for Line
Sped up ShiftArray