rails/rails — pull request #6293 by carlosantoniodasilva (2012-05-13 01:47:08+00:00)
Title: Improve and cleanup a bit partial renderer

Some refactoring for collection rendering:

* Remove post template assignment: there is no need for this assignment, given we are rendering a collection with different templates.
* Remove segments array with `<<` in favor of `Array#map`
* Use local vars whenever possible, including a local var for indexing
* Cache local template keys, remove defaults from find_template

This is somewhat related to the discussion in #6006. [Here are some quick benchmarks](https://gist.github.com/2553080). If it's necessary I can try to prepare another.

@josevalim could you take a look please?

Any feedback is welcome. Thanks!