This chnage does not look right.

The range is 0..count-1, so index must be at most count-1, so the original test looks fine.

It is hard to read, I would change it to:


This should be (index < 0 || index >= count)