1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

cleanup: replace C for loops with range

This commit is contained in:
spaceface777
2020-02-24 17:55:16 +01:00
committed by GitHub
parent 5918946feb
commit ef8c1203b4
50 changed files with 168 additions and 170 deletions

View File

@@ -28,10 +28,10 @@ fn (s string) add(a string) string {
len: new_len
str: malloc(new_len + 1)
}
for j := 0; j < s.len; j++ {
for j in 0..s.len {
res[j] = s[j]
}
for j := 0; j < a.len; j++ {
for j in 0..a.len {
res[s.len + j] = a[j]
}
res[new_len] = `\0`// V strings are not null terminated, but just in case