Created
October 19, 2012 21:59
-
-
Save LeifWarner/3920972 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Java::ScalaCollection::TraversableOnce | |
include Enumerable | |
def each(&f) | |
foreach(f) | |
end | |
# Cribbed from | |
# https://github.com/scala/scala/blob/v2.9.2/src/library/scala/collection/TraversableOnce.scala#L231 | |
def to_a | |
result = java.lang.Object[length].new | |
copyToArray(result, 0) | |
result.to_a | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment