Improve speed of pipeline that has a lot of items.

Remove duplicate `getItems()` call which can be expensive if a lot of items are in the pipeline.