# std: ArrayList.initCapacity now respects the specified cap · gitcafe/zig

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

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

Visibility: public

Requested revision: 5f31d54064b204910c18667d0b68b8bf2b57cffb

Requested commit: 5f31d54064b204910c18667d0b68b8bf2b57cffb

Commit: 5f31d54064b204910c18667d0b68b8bf2b57cffb

Tree: d13c9564e976e8b34aea6c196410830f792370c5

Author: LemonBoy

Committer: LemonBoy

## Message

```
std: ArrayList.initCapacity now respects the specified cap

Don't use the user-supplied cap as starting point for a resize. Doing so
overallocates memory and thus negates the whole point of specifying a
precise cap value.

```

## Parents

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

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