Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Hash#each_key instead of Hash#keys.each
Hash#keys.each allocates an array of keys. Hash#each_key iterates through the keys without allocating a new array and as such is a better, more specific tool for the job.
- Loading branch information
ee571fe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hash#each_key arrived with Ruby 1.9, but Rails itself dropped support for Ruby 1.8 and the upcoming Rails 5 scheduled for next summer will target Ruby 2.2 and up only. In short, anyone still using Ruby 1.8 will need to use an earlier Ransack release than the upcoming Ransack 1.6.0.