authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-16 18:32:52-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-07-16 18:32:52-07:00
loga576082170b66087f92c09cc1c7315d43e04b39c
treefc06b0a9db536e3127d95d93b7fc30f71c52ecd9
parentc6aa29b6fdba1606bfd218b17de89f64179c0ed8

std: reword some comments


2 files changed, 4 insertions(+), 5 deletions(-)

lib/std/array_hash_map.zig+1-1
......@@ -728,7 +728,7 @@ pub fn ArrayHashMapUnmanaged(
728728 }
729729
730730 const index = self.entries.addOneAssumeCapacity();
731 // unsafe indexing because the length changed
731 // The slice length changed, so we directly index the pointer.
732732 if (store_hash) hashes_array.ptr[index] = h;
733733
734734 return GetOrPutResult{
lib/std/array_list.zig+3-4
......@@ -501,8 +501,7 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type {
501501 /// Returns a slice of all the items plus the extra capacity, whose memory
502502 /// contents are `undefined`.
503503 pub fn allocatedSlice(self: Self) Slice {
504 // For a nicer API, `items.len` is the length, not the capacity.
505 // This requires "unsafe" slicing.
504 // `items.len` is the length, not the capacity.
506505 return self.items.ptr[0..self.capacity];
507506 }
508507
......@@ -1010,8 +1009,8 @@ pub fn ArrayListAlignedUnmanaged(comptime T: type, comptime alignment: ?u29) typ
10101009 return self.pop();
10111010 }
10121011
1013 /// For a nicer API, `items.len` is the length, not the capacity.
1014 /// This requires "unsafe" slicing.
1012 /// Returns a slice of all the items plus the extra capacity, whose memory
1013 /// contents are `undefined`.
10151014 pub fn allocatedSlice(self: Self) Slice {
10161015 return self.items.ptr[0..self.capacity];
10171016 }