summaryrefslogtreecommitdiff
path: root/lib/std/strfind.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/strfind.myr
parentae9a74441cba3160943ad18bf500781143bff096 (diff)
downloadmc-610852e18629b8a9a4c4f4ed6e6fc7a336152511.tar.gz
Move to use 'for var i = ...' construct.
Diffstat (limited to 'lib/std/strfind.myr')
-rw-r--r--lib/std/strfind.myr8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/strfind.myr b/lib/std/strfind.myr
index 0ec0e85..7336b8d 100644
--- a/lib/std/strfind.myr
+++ b/lib/std/strfind.myr
@@ -16,13 +16,13 @@ const strrfind = {haystack, needle
}
const strfindin = {haystack, needle, start, end
- var i, j, inc : size
+ var inc : size
inc = 1
if start > end
inc = -1
;;
- for i = start; i != end; i += inc
+ for var i = start; i != end; i += inc
/*
if we knew the direction we could terminate early,
but we allow the start and end to be passed in.
@@ -31,7 +31,7 @@ const strfindin = {haystack, needle, start, end
continue
;;
if haystack[i] == needle[0]
- for j = 0; j < needle.len; j++
+ for var j = 0; j < needle.len; j++
if haystack[i + j] != needle[j]
goto nextiter
;;
@@ -48,4 +48,4 @@ const strhas = {haystack, needle
| `Some _: -> true
| `None: -> false
;;
-} \ No newline at end of file
+}