diff options
author | Paul Phillips <paulp@improving.org> | 2009-02-28 21:32:38 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-02-28 21:32:38 +0000 |
commit | 305fe3a352099315df2cd409e918b712485af15d (patch) | |
tree | b834d367b2c3f7b074800c9a53c539e61bc0a252 /src/library | |
parent | 04949bcfb53515dce40e7c205aa370b49a519917 (diff) | |
download | scala-305fe3a352099315df2cd409e918b712485af15d.tar.gz scala-305fe3a352099315df2cd409e918b712485af15d.tar.bz2 scala-305fe3a352099315df2cd409e918b712485af15d.zip |
Iterable no-arg mkString changed to call mkStri...
Iterable no-arg mkString changed to call mkString() to avoid NPEs.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/Iterable.scala | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/library/scala/Iterable.scala b/src/library/scala/Iterable.scala index b66fd94aba..a09d23863a 100644 --- a/src/library/scala/Iterable.scala +++ b/src/library/scala/Iterable.scala @@ -439,11 +439,7 @@ trait Iterable[+A] { /** Converts a collection into a flat <code>String</code> by each element's toString method. * @note Will not terminate for infinite-sized collections. */ - def mkString = { - val buf = new StringBuilder - foreach(buf append _.toString) - buf.toString - } + def mkString: String = mkString("") /** Write all elements of this string into given string builder. * |