diff options
| author | gingerBill <bill@gingerbill.org> | 2024-08-13 14:27:25 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2024-08-13 14:27:25 +0100 |
| commit | 62911539cd8c3fc5372e0e65285b6db8fd704cd5 (patch) | |
| tree | 52a9882fefc4ece5c5049efcb9a5c7a63d767da7 /core/bytes | |
| parent | e3d5bbe62c34e6d84e59d3c8b78ff9e2dc1f348d (diff) | |
Minor style change
Diffstat (limited to 'core/bytes')
| -rw-r--r-- | core/bytes/bytes.odin | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/core/bytes/bytes.odin b/core/bytes/bytes.odin index 8e7bc01bd..72f1a3e92 100644 --- a/core/bytes/bytes.odin +++ b/core/bytes/bytes.odin @@ -348,7 +348,7 @@ index_byte :: proc(s: []byte, c: byte) -> (index: int) #no_bounds_check { return -1 } - ptr := cast(int)cast(uintptr)raw_data(s) + ptr := int(uintptr(raw_data(s))) alignment_start := (SIMD_SCAN_WIDTH - ptr % SIMD_SCAN_WIDTH) % SIMD_SCAN_WIDTH @@ -367,14 +367,14 @@ index_byte :: proc(s: []byte, c: byte) -> (index: int) #no_bounds_check { tail := length - (length - alignment_start) % SIMD_SCAN_WIDTH for /**/; i < tail; i += SIMD_SCAN_WIDTH { - load := (cast(^#simd[SIMD_SCAN_WIDTH]u8)(&s[i]))^ + load := (^#simd[SIMD_SCAN_WIDTH]u8)(&s[i])^ comparison := intrinsics.simd_lanes_eq(load, scanner) match := intrinsics.simd_reduce_or(comparison) if match > 0 { sentinel: #simd[SIMD_SCAN_WIDTH]u8 = u8(0xFF) index_select := intrinsics.simd_select(comparison, simd_scanner_indices, sentinel) index_reduce := intrinsics.simd_reduce_min(index_select) - return i + cast(int)index_reduce + return i + int(index_reduce) } } @@ -415,7 +415,7 @@ last_index_byte :: proc(s: []byte, c: byte) -> int #no_bounds_check { return -1 } - ptr := cast(int)cast(uintptr)raw_data(s) + ptr := int(uintptr(raw_data(s))) tail := length - (ptr + length) % SIMD_SCAN_WIDTH @@ -436,14 +436,14 @@ last_index_byte :: proc(s: []byte, c: byte) -> int #no_bounds_check { i -= SIMD_SCAN_WIDTH - 1 for /**/; i >= alignment_start; i -= SIMD_SCAN_WIDTH { - load := (cast(^#simd[SIMD_SCAN_WIDTH]u8)(&s[i]))^ + load := (^#simd[SIMD_SCAN_WIDTH]u8)(&s[i])^ comparison := intrinsics.simd_lanes_eq(load, scanner) match := intrinsics.simd_reduce_or(comparison) if match > 0 { sentinel: #simd[SIMD_SCAN_WIDTH]u8 index_select := intrinsics.simd_select(comparison, simd_scanner_indices, sentinel) index_reduce := intrinsics.simd_reduce_max(index_select) - return i + cast(int)index_reduce + return i + int(index_reduce) } } |