From dd1a80c56fb848003fb8c3028bc4555ce8388e44 Mon Sep 17 00:00:00 2001 From: unknown Date: Sun, 10 Mar 2013 22:12:18 +0100 Subject: [PATCH] Fixup for cycle RangeError invocation From: #1183 : Issue 9612: Cycle opSlice should throw when finish > start Because a RangeError is not actually customizable, and the first argument is actually the file name. The error was producing: ``` core.exception.RangeError@2 > 1(3836): Range violation ``` Now it produces: ``` core.exception.RangeError@std\range.d(3835): Range violation ``` --- std/range.d | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/std/range.d b/std/range.d index 7cb5516ab..01aea2279 100644 --- a/std/range.d +++ b/std/range.d @@ -3832,8 +3832,7 @@ struct Cycle(Range) auto opSlice(size_t i, size_t j) { - version (assert) - if (i > j) throw new RangeError(text(i, " > ", j)); + version (assert) if (i > j) throw new RangeError(); auto retval = this.save; retval._index += i; return takeExactly(retval, j - i); @@ -3934,8 +3933,7 @@ struct Cycle(R) auto opSlice(size_t i, size_t j) { - version (assert) - if (i > j) throw new RangeError(text(i, " > ", j)); + version (assert) if (i > j) throw new RangeError(); auto retval = this.save; retval._index += i; return takeExactly(retval, j - i);