Please sign in to comment.
This is a perf fix. Array#flatten is called in places which contain nested arrays of spec objects. (For example in Gem::Specification.find_in_unresolved.) Due to Ruby's implementation of Array#flatten, it will hit method_missing to try to dispatch the #to_ary method, which is slow. Implementing a #to_ary like this prevents method_missing getting called.
- Loading branch information...