assertArrayEquals performance and const improvement

the passed in arrays can be const

the length to travel need only be computed once