docs: Remove subjective claims from zero() method documentation

Focus on what the function does rather than why it should be used.
Remove context-dependent claims about efficiency, security, and use cases.
This commit is contained in:
Claude Bot
2025-07-30 21:21:41 +00:00
parent 76bf2a6ac0
commit 66c018c698

View File

@@ -605,17 +605,9 @@ pub fn MultiArrayList(comptime T: type) type {
/// Zero-initialize all allocated memory in the MultiArrayList.
///
/// This method efficiently clears the entire backing buffer by setting all bytes to zero,
/// which zero-initializes all fields across all elements in the list. This is more
/// efficient than iterating through individual elements or fields.
///
/// Use cases:
/// - Security: Clear sensitive data from memory
/// - Deterministic behavior: Ensure uninitialized memory doesn't contain garbage
/// - Testing: Create predictable initial states
///
/// Note: This operation affects the entire allocated capacity, not just the current length.
/// All reserved but unused capacity will also be zeroed.
/// Sets all bytes in the backing buffer to zero, which zero-initializes all fields
/// across all elements in the list. This operation affects the entire allocated
/// capacity, not just the current length.
pub fn zero(self: Self) void {
@memset(self.allocatedBytes(), 0);
}