minor performance improvement on arrayIndexOf