From 0cb7c109672f0a33d2221ccc9fd671661eb01d31 Mon Sep 17 00:00:00 2001
From: Samuel Gruetter <samuel.gruetter@epfl.ch>
Date: Mon, 9 Mar 2015 00:19:01 +0100
Subject: [PATCH] make sure List.slice allows taking empty slice or the whole
 list

---
 library/collection/List.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/library/collection/List.scala b/library/collection/List.scala
index 8e10e0d35..60519f3c0 100644
--- a/library/collection/List.scala
+++ b/library/collection/List.scala
@@ -98,7 +98,7 @@ sealed abstract class List[T] {
   )}
 
   def slice(from: BigInt, to: BigInt): List[T] = {
-    require(from < to && to < size && from >= 0)
+    require(0 <= from && from <= to && to <= size)
     drop(from).take(to-from)
   }
 
-- 
GitLab