summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2017-10-30 08:42:44 +0100
committerAndreas Rumpf <rumpf_a@web.de>2017-10-30 08:42:44 +0100
commita62051e304a0ca5dd2d1923cb290a1f788bad453 (patch)
tree1915e38cd5c259345c981b67b1b1b2854e4d2968
parentff9478fbf26be1e356d5de07057d0e5909c34fed (diff)
downloadNim-a62051e304a0ca5dd2d1923cb290a1f788bad453.tar.gz
updated algorithm.rotateLeft implementation
-rw-r--r--lib/pure/algorithm.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/pure/algorithm.nim b/lib/pure/algorithm.nim
index 1b0790706..02b381ad6 100644
--- a/lib/pure/algorithm.nim
+++ b/lib/pure/algorithm.nim
@@ -425,7 +425,7 @@ proc rotatedInternal[T](arg: openarray[T]; first, middle, last: int): seq[T] =
   for i in last ..< arg.len:
     result[i] = arg[i]
 
-proc rotateLeft*[T](arg: var openarray[T]; slice: Slice[int]; dist: int): int =
+proc rotateLeft*[T](arg: var openarray[T]; slice: Slice[int, int]; dist: int): int =
   ## Performs a left rotation on a range of elements. If you want to rotate right, use a negative ``dist``.
   ## Specifically, ``rotateLeft`` rotates the elements at ``slice`` by ``dist`` positions.
   ## The element at index ``slice.a + dist`` will be at index ``slice.a``.
@@ -457,7 +457,7 @@ proc rotateLeft*[T](arg: var openarray[T]; dist: int): int =
   let distLeft = ((dist mod arglen) + arglen) mod arglen
   arg.rotateInternal(0, distLeft, arglen)
 
-proc rotatedLeft*[T](arg: openarray[T]; slice: Slice[int], dist: int): seq[T] =
+proc rotatedLeft*[T](arg: openarray[T]; slice: Slice[int, int], dist: int): seq[T] =
   ## same as ``rotateLeft``, just with the difference that it does
   ## not modify the argument. It creates a new ``seq`` instead
   let sliceLen = slice.b + 1 - slice.a