From: Alexis Laferrière Date: Mon, 15 Feb 2016 20:12:06 +0000 (-0500) Subject: lib/text: `FlatString::substring` returns "" on count == 0 or less X-Git-Url: http://nitlanguage.org lib/text: `FlatString::substring` returns "" on count == 0 or less Signed-off-by: Alexis Laferrière --- diff --git a/lib/core/text/flat.nit b/lib/core/text/flat.nit index 9a70db8..47b8608 100644 --- a/lib/core/text/flat.nit +++ b/lib/core/text/flat.nit @@ -370,7 +370,7 @@ class FlatString redef fun substring(from, count) do - assert count >= 0 + if count <= 0 then return "" if from < 0 then count += from