diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2017-11-02 22:09:58 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2017-11-02 22:09:58 +0100 |
commit | 0f5261e9711c3fd57241874963bd5e45b11ed65e (patch) | |
tree | 0d5c101ccbf9010215ea291a0a7f443e5fe98004 /lib/system.nim | |
parent | cccdd9b58ef35f13c74abfd10cfd416a8f70061b (diff) | |
download | Nim-0f5261e9711c3fd57241874963bd5e45b11ed65e.tar.gz |
fixes #6675
Diffstat (limited to 'lib/system.nim')
-rw-r--r-- | lib/system.nim | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim index 92c5e009f..0cae4da87 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -3493,14 +3493,14 @@ proc `[]`*[Idx, T, U, V](a: array[Idx, T], x: HSlice[U, V]): seq[T] = let xa = a ^^ x.a let L = (a ^^ x.b) - xa + 1 result = newSeq[T](L) - for i in 0..<L: result[i] = a[Idx(i + xa + int low(a))] + for i in 0..<L: result[i] = a[Idx(i + xa)] proc `[]=`*[Idx, T, U, V](a: var array[Idx, T], x: HSlice[U, V], b: openArray[T]) = ## slice assignment for arrays. let xa = a ^^ x.a let L = (a ^^ x.b) - xa + 1 if L == b.len: - for i in 0..<L: a[Idx(i + xa + int low(a))] = b[i] + for i in 0..<L: a[Idx(i + xa)] = b[i] else: sysFatal(RangeError, "different lengths for slice assignment") |