diff options
author | schinz <schinz@epfl.ch> | 2003-03-03 15:42:19 +0000 |
---|---|---|
committer | schinz <schinz@epfl.ch> | 2003-03-03 15:42:19 +0000 |
commit | e8b06e776b8dd23a82b72bd9f0245fbfeadda376 (patch) | |
tree | 13db8544087c766d5ba4de4200babd4355148c52 | |
parent | 1be73bee0e9e16c69093963b238ab857764bd939 (diff) | |
download | scala-e8b06e776b8dd23a82b72bd9f0245fbfeadda376.tar.gz scala-e8b06e776b8dd23a82b72bd9f0245fbfeadda376.tar.bz2 scala-e8b06e776b8dd23a82b72bd9f0245fbfeadda376.zip |
- bug fix: "diff" works when "this" is the empt...
- bug fix: "diff" works when "this" is the empty list
-rw-r--r-- | sources/scala/List.scala | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sources/scala/List.scala b/sources/scala/List.scala index 34f7d7cf3d..503dc8b083 100644 --- a/sources/scala/List.scala +++ b/sources/scala/List.scala @@ -315,7 +315,7 @@ trait List[a] extends Seq[a] { * @return this list without the elements of the given list <code>that</code>. */ def diff(that: List[a]): List[a] = - if (that.isEmpty) this + if (this.isEmpty || that.isEmpty) this else { val result = this.tail diff that; if (that contains this.head) result else this.head :: result; |