| ... | @@ -501,8 +501,7 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type { | ... | @@ -501,8 +501,7 @@ pub fn ArrayListAligned(comptime T: type, comptime alignment: ?u29) type { |
| 501 | /// Returns a slice of all the items plus the extra capacity, whose memory | 501 | /// Returns a slice of all the items plus the extra capacity, whose memory |
| 502 | /// contents are `undefined`. | 502 | /// contents are `undefined`. |
| 503 | pub fn allocatedSlice(self: Self) Slice { | 503 | pub fn allocatedSlice(self: Self) Slice { |
| 504 | // For a nicer API, `items.len` is the length, not the capacity. | 504 | // `items.len` is the length, not the capacity. |
| 505 | // This requires "unsafe" slicing. | | |
| 506 | return self.items.ptr[0..self.capacity]; | 505 | return self.items.ptr[0..self.capacity]; |
| 507 | } | 506 | } |
| 508 | | 507 | |
| ... | @@ -1010,8 +1009,8 @@ pub fn ArrayListAlignedUnmanaged(comptime T: type, comptime alignment: ?u29) typ | ... | @@ -1010,8 +1009,8 @@ pub fn ArrayListAlignedUnmanaged(comptime T: type, comptime alignment: ?u29) typ |
| 1010 | return self.pop(); | 1009 | return self.pop(); |
| 1011 | } | 1010 | } |
| 1012 | | 1011 | |
| 1013 | /// For a nicer API, `items.len` is the length, not the capacity. | 1012 | /// Returns a slice of all the items plus the extra capacity, whose memory |
| 1014 | /// This requires "unsafe" slicing. | 1013 | /// contents are `undefined`. |
| 1015 | pub fn allocatedSlice(self: Self) Slice { | 1014 | pub fn allocatedSlice(self: Self) Slice { |
| 1016 | return self.items.ptr[0..self.capacity]; | 1015 | return self.items.ptr[0..self.capacity]; |
| 1017 | } | 1016 | } |