From b19e81862cd9fe9f66377f4afcb456cff7d468c0 Mon Sep 17 00:00:00 2001 From: Intege-rs Date: Fri, 11 Apr 2025 09:47:59 -0400 Subject: [PATCH] add zero and clear --- sub/core/src/arrays.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sub/core/src/arrays.rs b/sub/core/src/arrays.rs index 9eb7877..a08c156 100644 --- a/sub/core/src/arrays.rs +++ b/sub/core/src/arrays.rs @@ -57,6 +57,11 @@ impl FixedVec { unsafe { core::slice::from_raw_parts_mut(self.buffer.as_mut_ptr() as *mut T, self.length) } } + pub fn zero_and_clear(&mut self) { + self.as_slice_mut().fill(0); + self.length = 0; + } + pub fn clear(&mut self) { self.length = 0; }