Use indexes for array parameters
Store array/list size in a local variable for performance
Merge pull request #526 from ldiqual/master

Use indexes for array parameters