summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sources/scala/List.scala2
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;