DusanKasan / Knapsack

Collection pipeline library for PHP
http://dusankasan.github.io/Knapsack/
MIT License
535 stars 56 forks source link

Optimize the conditions whether the result should be converted to a Collection #35

Closed jdreesen closed 7 years ago

jdreesen commented 7 years ago

The Boolean argument $convertToCollection should be checked first because it's cheaper to check a Boolean than to call a function and if $convertToCollection is false the function call will be skipped.

This is a micro-optimization though.

DusanKasan commented 7 years ago

Makes sense. Thanks for the contribution.