diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2023-09-29 13:36:47 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-09-29 13:42:38 -0700 |
| commit | 9013970861176717aae3020f3f20434dc5220073 (patch) | |
| tree | b9475f7719505a871234ed1a83ab492c8201962a /lib/std/Thread.zig | |
| parent | 9d765b5ab5662622e8e2465e930d3905ed4612a4 (diff) | |
| download | zig-9013970861176717aae3020f3f20434dc5220073.tar.gz zig-9013970861176717aae3020f3f20434dc5220073.zip | |
std.ArrayList: fixups for the previous commit
* Move `computeBetterCapacity` to the bottom so that `pub` stuff shows
up first.
* Rename `computeBetterCapacity` to `growCapacity`. Every function
implicitly computes something; that word is always redundant in a
function name. "better" is vague. Better in what way? Instead we
describe what is actually happening. "grow".
* Improve doc comments to be very explicit about when element pointers
are invalidated or not.
* Rename `addManyAtIndex` to `addManyAt`. The parameter is named
`index`; that is enough.
* Extract some duplicated code into `addManyAtAssumeCapacity` and make
it `pub`.
* Since I audited every line of code for correctness, I changed the
style to my personal preference.
* Avoid a redundant `@memset` to `undefined` - memory allocation does
that already.
* Fixed comment giving the wrong reason for not calling
`ensureTotalCapacity`.
Diffstat (limited to 'lib/std/Thread.zig')
0 files changed, 0 insertions, 0 deletions
