# std.ArrayList: fixups for the previous commit · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/9013970861176717aae3020f3f20434dc5220073)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 9013970861176717aae3020f3f20434dc5220073

Requested commit: 9013970861176717aae3020f3f20434dc5220073

Commit: 9013970861176717aae3020f3f20434dc5220073

Tree: b9475f7719505a871234ed1a83ab492c8201962a

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
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`.

```

## Parents

- [9d765b5ab5662622e8e2465e930d3905ed4612a4](https://git.cafe/gitcafe/zig/commit/9d765b5ab5662622e8e2465e930d3905ed4612a4?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/9013970861176717aae3020f3f20434dc5220073?format=markdown)
