diff options
| author | Damian Tarnawski <gthetarnav@gmail.com> | 2025-09-15 15:01:20 +0200 |
|---|---|---|
| committer | Damian Tarnawski <gthetarnav@gmail.com> | 2025-09-15 15:01:20 +0200 |
| commit | b986c534a33cb10c99653b8f7eba63f260ad938f (patch) | |
| tree | 027f3c3f5cbab69dda77af84ecdf30aaa2b0eac5 /core | |
| parent | 7adc33d5a4c4ba9a84ce7ff3f99b3db65db1eab1 (diff) | |
Replace `mem.zero_slice` with `intrinsics.mem_zero` in `small_array.resize`
Diffstat (limited to 'core')
| -rw-r--r-- | core/container/small_array/small_array.odin | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/core/container/small_array/small_array.odin b/core/container/small_array/small_array.odin index 31cc8315e..23d5ad6b7 100644 --- a/core/container/small_array/small_array.odin +++ b/core/container/small_array/small_array.odin @@ -1,8 +1,8 @@ package container_small_array import "base:builtin" +@require import "base:intrinsics" @require import "base:runtime" -@require import "core:mem" /* A fixed-size stack-allocated array operated on in a dynamic fashion. @@ -285,11 +285,11 @@ Output: [1] [1, 2, 0, 0, 0] */ -resize :: proc "contextless" (a: ^$A/Small_Array, length: int) { +resize :: proc "contextless" (a: ^$A/Small_Array($N, $T), length: int) { prev_len := a.len a.len = min(length, builtin.len(a.data)) if prev_len < a.len { - mem.zero_slice(a.data[prev_len:a.len]) + intrinsics.mem_zero(&a.data[prev_len], size_of(T)*(a.len-prev_len)) } } |