Optimize simple array comparisons (Issue 9477)

That was fun!

![Test Results](https://dtestbadge.appspot.com)