Define `Array#to_a` to avoid unnecessary loops.

parent 914da3d7
......@@ -268,4 +268,8 @@ class Array
def sort(&block)
self.dup.sort!(&block)
end
def to_a
self
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment