summaryrefslogtreecommitdiff
path: root/lib/std/slcp.myr
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2015-09-12 09:01:39 -0700
committerOri Bernstein <ori@eigenstate.org>2015-09-15 23:01:09 -0700
commit610852e18629b8a9a4c4f4ed6e6fc7a336152511 (patch)
treeb69e2c8d29091b688115a499a50521d6d81cad1a /lib/std/slcp.myr
parentae9a74441cba3160943ad18bf500781143bff096 (diff)
downloadmc-610852e18629b8a9a4c4f4ed6e6fc7a336152511.tar.gz
Move to use 'for var i = ...' construct.
Diffstat (limited to 'lib/std/slcp.myr')
-rw-r--r--lib/std/slcp.myr5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/std/slcp.myr b/lib/std/slcp.myr
index 1035a29..b2c9760 100644
--- a/lib/std/slcp.myr
+++ b/lib/std/slcp.myr
@@ -6,7 +6,6 @@ pkg std =
;;
generic slcp = {a : @a[:], b : @a[:]
- var i
var addr_a, addr_b
assert(a.len == b.len, "arguments to slcp() must be of equal length")
@@ -14,11 +13,11 @@ generic slcp = {a : @a[:], b : @a[:]
addr_a = a castto(@a#) castto(intptr)
addr_b = b castto(@a#) castto(intptr)
if addr_a <= addr_b
- for i = 0; i < a.len; i++
+ for var i = 0; i < a.len; i++
a[i] = b[i]
;;
else
- for i = a.len; i > 0; i--
+ for var i = a.len; i > 0; i--
a[i - 1] = b[i - 1]
;;
;;