Use more Natural and Positive numbers in proc parameters
- Didn't go through all modules, only the main ones I thought of - Building the compiler and tests still work
This commit is contained in:
parent
99e0fb90e0
commit
22b4e4c2f2
10 changed files with 1196 additions and 1196 deletions
|
|
@ -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,7 +37,7 @@ 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue