diff options
author | Simon Hafner <hafnersimon@gmail.com> | 2015-05-13 12:06:05 -0500 |
---|---|---|
committer | Simon Hafner <hafnersimon@gmail.com> | 2015-05-13 12:06:05 -0500 |
commit | 9c4a74637db266c3cfcffcfb1e65bae982c6e4bf (patch) | |
tree | 495f50a989d7ab696ddb0b7b0e815c572ab27f3c /lib/pure/algorithm.nim | |
parent | c55f884b5c0ebc0b637138a8de446ba1fd05acdf (diff) | |
parent | 0b184f2584221543a7dec9c8ae4a700533919e0c (diff) | |
download | Nim-9c4a74637db266c3cfcffcfb1e65bae982c6e4bf.tar.gz |
Merge branch 'devel' into jpoirier-realtimeGCTest
Diffstat (limited to 'lib/pure/algorithm.nim')
-rw-r--r-- | lib/pure/algorithm.nim | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim index a1ab7be13..f7ccb9234 100644 --- a/lib/pure/algorithm.nim +++ b/lib/pure/algorithm.nim @@ -24,7 +24,7 @@ proc `*`*(x: int, order: SortOrder): int {.inline.} = var y = order.ord - 1 result = (x xor y) - y -proc reverse*[T](a: var openArray[T], first, last: int) = +proc reverse*[T](a: var openArray[T], first, last: Natural) = ## reverses the array ``a[first..last]``. var x = first var y = last @@ -37,11 +37,11 @@ proc reverse*[T](a: var openArray[T]) = ## reverses the array `a`. reverse(a, 0, a.high) -proc reversed*[T](a: openArray[T], first, last: int): seq[T] = +proc reversed*[T](a: openArray[T], first, last: Natural): seq[T] = ## returns the reverse of the array `a[first..last]`. result = newSeq[T](last - first + 1) - var x = first - var y = last + var x = first.int + var y = last.int while x <= last: result[x] = a[y] dec(y) |