Improve efficiency of queue loop

This commit avoids a property lookup on every iteration of the
queue-consuming loop by first storing it in a variable, since we don't
expect the size of the array to change within the duration of the loop.
This will make the initialization slightly more efficient.

Change-Id: Ied891fd5fd360c9732e61c7cf8a645ec63801cc6
Reviewed-on: https://gerrit.causes.com/23783
Tested-by: Joe Lencioni <joe.lencioni@causes.com>
Reviewed-by: Greg Hurrell <greg@causes.com>