HomePhorge

(#9671) Use Array#concat rather than +=
ad4316ad4122Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

(#9671) Use Array#concat rather than +=

+= reassigns the variable it's used on, which means it creates a new
copy of the array each time, which is slow and wasteful. Array#concat,
on the other hand, modifies the object to which the variable refers,
requiring no copy and leaving no orphaned array, and so is much, much
faster.

Paired-With: Josh Cooper <josh@puppetlabs.com>

Details

Provenance
Nick Lewis <nick@puppetlabs.com>Authored on
vanmeeuwenPushed on Jun 2 2015, 2:22 PM
Parents
rPU20260f3fb175: maint: Correct the spelling of sentinel
Branches
Unknown
Tags
Unknown

Event Timeline

Nick Lewis <nick@puppetlabs.com> committed rPUad4316ad4122: (#9671) Use Array#concat rather than += (authored by Nick Lewis <nick@puppetlabs.com>).Nov 11 2011, 11:26 PM