Reduce number of range and slice operators #239

Replace .. and ... with : and ..
This commit is contained in:
gingerBill
2018-08-01 21:34:59 +01:00
parent a6fe656f21
commit 0718f14774
31 changed files with 204 additions and 219 deletions
+2 -2
View File
@@ -62,7 +62,7 @@ compare :: proc "contextless" (a, b: []byte) -> int {
}
compare_byte_ptrs :: proc "contextless" (a, b: ^byte, n: int) -> int {
pa :: ptr_offset;
for i in 0..n do switch {
for i in 0..n-1 do switch {
case pa(a, i)^ < pa(b, i)^: return -1;
case pa(a, i)^ > pa(b, i)^: return +1;
}
@@ -147,7 +147,7 @@ allocation_header_fill :: proc(header: ^AllocationHeader, data: rawptr, size: in
ptr := cast(^uint)(ptr_offset(header, 1));
n := ptr_sub(cast(^uint)data, ptr);
for i in 0..n {
for i in 0..n-1 {
ptr_offset(ptr, i)^ = ~uint(0);
}
}