summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/library/scala/List.scala12
-rw-r--r--src/library/scala/runtime/StringAdd.scala7
2 files changed, 9 insertions, 10 deletions
diff --git a/src/library/scala/List.scala b/src/library/scala/List.scala
index 537f649a8a..00b9112807 100644
--- a/src/library/scala/List.scala
+++ b/src/library/scala/List.scala
@@ -354,9 +354,15 @@ object List {
* @param xss the list of lists
* @return the transposed list of lists
*/
- def transpose[A](xss: List[List[A]]): List[List[A]] =
- if (xss.head.isEmpty) List()
- else (xss map (xs => xs.head)) :: transpose(xss map (xs => xs.tail))
+ def transpose[A](xss: List[List[A]]): List[List[A]] = {
+ val buf = new ListBuffer[List[A]]
+ var yss = xss
+ while (!yss.head.isEmpty) {
+ buf += (yss map (_.head))
+ yss = (yss map (_.tail))
+ }
+ buf.toList
+ }
/** Lists with ordered elements are ordered
implicit def list2ordered[a <% Ordered[a]](x: List[a]): Ordered[List[a]] = new Ordered[List[a]] {
diff --git a/src/library/scala/runtime/StringAdd.scala b/src/library/scala/runtime/StringAdd.scala
index a7da9a5d17..2ca64538d9 100644
--- a/src/library/scala/runtime/StringAdd.scala
+++ b/src/library/scala/runtime/StringAdd.scala
@@ -18,13 +18,6 @@ final class StringAdd(self: Any) {
def +(other: String) = self.toString + other
- /** Formats string according to given <code>locale</code> and
- * <code>format</code> string. Formatstrings are as for
- * <code>String.format</code> (@see java.lang.String.format)
- */
- def format(locale: java.util.Locale, format: String): String =
- String.format(locale, format, Array(self.asInstanceOf[Object]))
-
/** Formats string according to given <code>format</code> string.
* Format strings are as for <code>String.format</code>
* (@see java.lang.String.format).