dagolden / Data-Fake

Declaratively generate fake structured data for testing
https://metacpan.org/author/DAGOLDEN
5 stars 4 forks source link

Removed some duplicated code by using recursion. #6

Closed stuartskelton closed 8 years ago

stuartskelton commented 8 years ago

I have removed some duplicated code by using _transform to do some recursion, as _transform already does this unpacking already.

xdg commented 8 years ago

Thank you for sending a PR. However, given that the code exists, I see no reason to remove it. Data::Fake is already very heavy on function calls, which are slow in Perl. Saving a _transform call to produce literal values or to run a code reference cuts down on unnecessary function calls, which speeds up generation. I don't mind a minor bit of duplication for that benefit.

stuartskelton commented 8 years ago

That is quite fair.

xdg commented 8 years ago

Thanks for being so understanding.