mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std: reword some comments
This commit is contained in:
parent
c6aa29b6fd
commit
a576082170
2 changed files with 4 additions and 5 deletions
|
|
@ -728,7 +728,7 @@ pub fn ArrayHashMapUnmanaged(
|
|||
}
|
||||
|
||||
const index = self.entries.addOneAssumeCapacity();
|
||||
// unsafe indexing because the length changed
|
||||
// The slice length changed, so we directly index the pointer.
|
||||
if (store_hash) hashes_array.ptr[index] = h;
|
||||
|
||||
return GetOrPutResult{
|
||||
|
|
|
|||
|
|
@ -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];
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue