Avoid the creation of new arrays to do comparison

From:

real	0m5.689s
user	0m5.674s
sys	0m0.013s

To:

real	0m2.154s
user	0m2.140s
sys	0m0.012s