mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 15:48:51 +00:00
Reduce number of range and slice operators #239
Replace .. and ... with : and ..
This commit is contained in:
+2
-2
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user