summaryrefslogtreecommitdiff
path: root/lib/std/cstrconv.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/cstrconv.myr
parentae9a74441cba3160943ad18bf500781143bff096 (diff)
downloadmc-610852e18629b8a9a4c4f4ed6e6fc7a336152511.tar.gz
Move to use 'for var i = ...' construct.
Diffstat (limited to 'lib/std/cstrconv.myr')
-rw-r--r--lib/std/cstrconv.myr12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/std/cstrconv.myr b/lib/std/cstrconv.myr
index fa9e0bf..a517e19 100644
--- a/lib/std/cstrconv.myr
+++ b/lib/std/cstrconv.myr
@@ -7,9 +7,7 @@ pkg std =
;;
const cstrconv = {buf
- var i
-
- for i = 0; i < buf.len; i++
+ for var i = 0; i < buf.len; i++
if buf[i] == 0
-> buf[:i]
;;
@@ -29,12 +27,10 @@ const cstrconvp = {p
}
const cstrlen = {buf
- var i
-
- for i = 0; i < buf.len; i++
+ for var i = 0; i < buf.len; i++
if buf[i] == 0
- break
+ -> i
;;
;;
- -> i
+ -> 0
}