diff options
Diffstat (limited to 'lib/std/strfind.myr')
-rw-r--r-- | lib/std/strfind.myr | 8 |
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 +} |