aboutsummaryrefslogtreecommitdiff
path: root/lib/std/array_list.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2023-07-16 18:32:52 -0700
committerAndrew Kelley <andrew@ziglang.org>2023-07-16 18:32:52 -0700
commita576082170b66087f92c09cc1c7315d43e04b39c (patch)
treefc06b0a9db536e3127d95d93b7fc30f71c52ecd9 /lib/std/array_list.zig
parentc6aa29b6fdba1606bfd218b17de89f64179c0ed8 (diff)
downloadzig-a576082170b66087f92c09cc1c7315d43e04b39c.tar.gz
zig-a576082170b66087f92c09cc1c7315d43e04b39c.zip
std: reword some comments
Diffstat (limited to 'lib/std/array_list.zig')
-rw-r--r--lib/std/array_list.zig7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/std/array_list.zig b/lib/std/array_list.zig
index b7180c9e31..ec38fad50b 100644
--- a/lib/std/array_list.zig
+++ b/lib/std/array_list.zig
@@ -501,8 +501,7 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {
/// Returns a slice of all the items plus the extra capacity, whose memory
/// contents are `undefined`.
pub fn allocatedSlice(self: Self) Slice {
- // For a nicer API, `items.len` is the length, not the capacity.
- // This requires "unsafe" slicing.
+ // `items.len` is the length, not the capacity.
return self.items.ptr[0..self.capacity];
}
@@ -1010,8 +1009,8 @@ pub fn ArrayListAlignedUnmanaged(comptime T: type, comptime alignment: ?u29) typ
return self.pop();
}
- /// For a nicer API, `items.len` is the length, not the capacity.
- /// This requires "unsafe" slicing.
+ /// Returns a slice of all the items plus the extra capacity, whose memory
+ /// contents are `undefined`.
pub fn allocatedSlice(self: Self) Slice {
return self.items.ptr[0..self.capacity];
}