mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
std: reword some comments
This commit is contained in:
parent
c6aa29b6fd
commit
a576082170
@ -728,7 +728,7 @@ pub fn ArrayHashMapUnmanaged(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const index = self.entries.addOneAssumeCapacity();
|
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;
|
if (store_hash) hashes_array.ptr[index] = h;
|
||||||
|
|
||||||
return GetOrPutResult{
|
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
|
/// Returns a slice of all the items plus the extra capacity, whose memory
|
||||||
/// contents are `undefined`.
|
/// contents are `undefined`.
|
||||||
pub fn allocatedSlice(self: Self) Slice {
|
pub fn allocatedSlice(self: Self) Slice {
|
||||||
// For a nicer API, `items.len` is the length, not the capacity.
|
// `items.len` is the length, not the capacity.
|
||||||
// This requires "unsafe" slicing.
|
|
||||||
return self.items.ptr[0..self.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();
|
return self.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// For a nicer API, `items.len` is the length, not the capacity.
|
/// Returns a slice of all the items plus the extra capacity, whose memory
|
||||||
/// This requires "unsafe" slicing.
|
/// contents are `undefined`.
|
||||||
pub fn allocatedSlice(self: Self) Slice {
|
pub fn allocatedSlice(self: Self) Slice {
|
||||||
return self.items.ptr[0..self.capacity];
|
return self.items.ptr[0..self.capacity];
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user